







 


enum EstKbd	{kbdParado = 0, kbdRdCol1, kbdRdCol2, kbdRdCol3};

void ReadKbd(void);
unsigned int TeclaVal(void);


















 


 
 

  #pragma system_include

 
 

 

  #pragma system_include






 















 






 
 


  #pragma system_include

 
 

 

  #pragma system_include






 















 





                 



                 













 

   



                 



























 


  #pragma system_include

 
 
 


  #pragma system_include

 

   

 

   #pragma system_include






 

 


 


 

 

 

 

 

 

 

 





 


  typedef struct
  {
    char *_Ap;
  } _VA_LIST;


















 














 




















 










 




















































































































 


 










 





















 














 















 













 








 












 











 










 









 











 









 









 









 









 














 














 
















 












 








 











 










 









 









 









 









 









 









 









 









 







 




 









 




 





 







































 













 






 


   

  







 





 





 




 



 





 




 












 
   






                 



















 


                 

 

 
 

 

 

 

 



                 







 
 


  #pragma system_include

 
 

 

  #pragma system_include






 















 




 
 





 

                                 




                                 







                 

                 

                 

                 
                 



                 
                                 


  #pragma language=save
  #pragma language=extended
  typedef long long _Longlong;
  typedef unsigned long long _ULonglong;
  #pragma language=restore

  typedef unsigned short int _Wchart;
  typedef unsigned short int _Wintt;



                 

typedef signed int  _Ptrdifft;
typedef unsigned int     _Sizet;

 

                 
  typedef _VA_LIST __Va_list;


__intrinsic __nounwind void __iar_Atexit(void (*)(void));


  typedef struct
  {        
    unsigned int _Wchar;
    unsigned int _State;
  } _Mbstatet;



typedef struct
{        
  _Longlong _Off;     
  _Mbstatet _Wstate;
} _Fpost;




                 














 


  #pragma system_include












































































 

 


  
 

  

 

  








 
  
  

















































































 


  



  #pragma language=save 
  #pragma language=extended
  __intrinsic __nounwind void __iar_dlib_perthread_initialize(void  *);
  __intrinsic __nounwind void  *__iar_dlib_perthread_allocate(void);
  __intrinsic __nounwind void __iar_dlib_perthread_destroy(void);
  __intrinsic __nounwind void __iar_dlib_perthread_deallocate(void  *);

  #pragma segment = "__DLIB_PERTHREAD"
  #pragma segment = "__DLIB_PERTHREAD_init"








   
  void  *__iar_dlib_perthread_access(void  *);
  #pragma language=restore








     
  



   

  


  
  typedef void *__iar_Rmtx;

  __intrinsic __nounwind void __iar_system_Mtxinit(__iar_Rmtx *m);
  __intrinsic __nounwind void __iar_system_Mtxdst(__iar_Rmtx *m);
  __intrinsic __nounwind void __iar_system_Mtxlock(__iar_Rmtx *m);
  __intrinsic __nounwind void __iar_system_Mtxunlock(__iar_Rmtx *m);

  __intrinsic __nounwind void __iar_file_Mtxinit(__iar_Rmtx *m);
  __intrinsic __nounwind void __iar_file_Mtxdst(__iar_Rmtx *m);
  __intrinsic __nounwind void __iar_file_Mtxlock(__iar_Rmtx *m);
  __intrinsic __nounwind void __iar_file_Mtxunlock(__iar_Rmtx *m);

  
 
  __intrinsic __nounwind void __iar_clearlocks(void);



  



  


  typedef unsigned _Once_t;

  








                 


                 
  
  
  __intrinsic __nounwind void __iar_Locksyslock(unsigned int);
  __intrinsic __nounwind void __iar_Unlocksyslock(unsigned int);
  
  


                 


                 







 
 
 


  #pragma system_include

 
 

 

  #pragma system_include






 















 






                 
typedef _Sizet size_t;

typedef unsigned int __data_size_t;




 
 

  #pragma system_include





 

__intrinsic __nounwind int remove(const char *);
__intrinsic __nounwind int rename(const char *, const char *);









 



 
#pragma rtmodel="__dlib_file_descriptor","0"

                 









                 
typedef _Fpost fpos_t;

                 
#pragma language=save
#pragma language=extended




 
__intrinsic __nounwind char * __gets(char *, int);
__intrinsic __nounwind char * gets(char *);
__intrinsic __nounwind void perror(const char *);
_Pragma("__printf_args") __intrinsic __nounwind int printf(const char *, ...);
__intrinsic __nounwind int puts(const char *);
_Pragma("__scanf_args")  __intrinsic __nounwind int scanf(const char *, ...);
_Pragma("__printf_args") __intrinsic __nounwind int sprintf(char *, const char *, 
                                    ...);
_Pragma("__scanf_args")  __intrinsic __nounwind int sscanf(const char *, 
                                   const char *, ...);
__intrinsic __nounwind char * tmpnam(char *);
 
__intrinsic __nounwind int __ungetchar(int);
_Pragma("__printf_args") __intrinsic __nounwind int vprintf(const char *, __Va_list);
  _Pragma("__scanf_args")  __intrinsic __nounwind int vscanf(const char *, __Va_list);
  _Pragma("__scanf_args")  __intrinsic __nounwind int vsscanf(const char *, 
                                      const char *, __Va_list);
_Pragma("__printf_args") __intrinsic __nounwind int vsprintf(char *, const char *,
                                     __Va_list);
 
__intrinsic __nounwind size_t __write_array(const void *, size_t, size_t);
  _Pragma("__printf_args") __intrinsic __nounwind int snprintf(char *, size_t, 
                                       const char *, ...);
  _Pragma("__printf_args") __intrinsic __nounwind int vsnprintf(char *, size_t,
                                        const char *, __Va_list);

__intrinsic __nounwind int getchar(void);
__intrinsic __nounwind int putchar(int);



#pragma language=restore









 
 
 

  #pragma system_include

 
 

 

  #pragma system_include






 















 




 
 












 


  #pragma system_include


  
  

  





 


  




 


  


 

  #pragma inline
  __intrinsic __nounwind void * memcpy(void * _D, const void * _S, size_t _N)
  {
    __aeabi_memcpy(_D, _S, _N);
    return _D;
  }

  #pragma inline
  __intrinsic __nounwind void * memmove(void * _D, const void * _S, size_t _N)
  {
    __aeabi_memmove(_D, _S, _N);
    return _D;
  }

  #pragma inline
  __intrinsic __nounwind void * memset(void * _D, int _C, size_t _N)
  {
    __aeabi_memset(_D, _N, _C);
    return _D;
  }

  
  




                 

                 

__intrinsic __nounwind int memcmp(const void *, const void *, size_t);
__intrinsic __nounwind void * memcpy(void *, const void *, size_t);
__intrinsic __nounwind void * memmove(void *, const void *, size_t);
__intrinsic __nounwind void * memset(void *, int, size_t);
__intrinsic __nounwind char * strcat(char *, const char *);
__intrinsic __nounwind int strcmp(const char *, const char *);
__intrinsic __nounwind int strcoll(const char *, const char *);
__intrinsic __nounwind char * strcpy(char *, const char *);
__intrinsic __nounwind size_t strcspn(const char *, const char *);
__intrinsic __nounwind char * strerror(int);
__intrinsic __nounwind size_t strlen(const char *);
__intrinsic __nounwind char * strncat(char *, const char *, size_t);
__intrinsic __nounwind int strncmp(const char *, const char *, size_t);
__intrinsic __nounwind char * strncpy(char *, const char *, size_t);
__intrinsic __nounwind size_t strspn(const char *, const char *);
__intrinsic __nounwind char * strtok(char *, const char *);
__intrinsic __nounwind size_t strxfrm(char *, const char *, size_t);

  __intrinsic __nounwind char *strdup(const char *);
  __intrinsic __nounwind int strcasecmp(const char *, const char *);
  __intrinsic __nounwind int strncasecmp(const char *, const char *, size_t);
  __intrinsic __nounwind char *strtok_r(char *, const char *, char **);
  __intrinsic __nounwind size_t strnlen(char const *, size_t);



  __intrinsic __nounwind void *memchr(const void *_S, int _C, size_t _N);
  __intrinsic __nounwind char *strchr(const char *_S, int _C);
  __intrinsic __nounwind char *strpbrk(const char *_S, const char *_P);
  __intrinsic __nounwind char *strrchr(const char *_S, int _C);
  __intrinsic __nounwind char *strstr(const char *_S, const char *_P);


                 

                 

__intrinsic __nounwind void *__iar_Memchr(const void *, int, size_t);
__intrinsic __nounwind char *__iar_Strchr(const char *, int);
__intrinsic __nounwind char *__iar_Strerror(int, char *);
__intrinsic __nounwind char *__iar_Strpbrk(const char *, const char *);
__intrinsic __nounwind char *__iar_Strrchr(const char *, int);
__intrinsic __nounwind char *__iar_Strstr(const char *, const char *);


                 
                 
    #pragma inline
    void *memchr(const void *_S, int _C, size_t _N)
    {
      return (__iar_Memchr(_S, _C, _N));
    }

    #pragma inline
    char *strchr(const char *_S, int _C)
    {
      return (__iar_Strchr(_S, _C));
    }

    #pragma inline
    char *strpbrk(const char *_S, const char *_P)
    {
      return (__iar_Strpbrk(_S, _P));
    }

    #pragma inline
    char *strrchr(const char *_S, int _C)
    {
      return (__iar_Strrchr(_S, _C));
    }

    #pragma inline
    char *strstr(const char *_S, const char *_P)
    {
      return (__iar_Strstr(_S, _P));
    }

  #pragma inline
  char *strerror(int _Err)
  {
    return (__iar_Strerror(_Err, 0));
  }









 
 
 

  #pragma system_include

 
 

 

  #pragma system_include






 















 







 
 


  #pragma system_include

 
 

 

  #pragma system_include






 















 





 
 

  #pragma system_include

 
 

  #pragma system_include

 
 

 

  #pragma system_include






 















 





 
 


  #pragma system_include

 
 

 

  #pragma system_include






 















 




 
 




 
#pragma rtmodel="__dlib_full_locale_support",   "0"




extern int __aeabi_MB_CUR_MAX(void);





                 



                 
  typedef _Wchart wchar_t;

typedef struct
{        
  int quot;
  int rem;
} div_t;

typedef struct
{        
  long quot;
  long rem;
} ldiv_t;

    #pragma language=save
    #pragma language=extended
    typedef struct
    {      
      _Longlong quot;
      _Longlong rem;
    } lldiv_t;
    #pragma language=restore

                 
  
__intrinsic __nounwind int atexit(void (*)(void));
  __intrinsic __noreturn __nounwind void _Exit(int) ;
__intrinsic __noreturn __nounwind void exit(int) ;
__intrinsic __nounwind char * getenv(const char *);
__intrinsic __nounwind int system(const char *);



__intrinsic __noreturn __nounwind void abort(void) ;
__intrinsic __nounwind int abs(int);
__intrinsic __nounwind void * calloc(size_t, size_t);
__intrinsic __nounwind div_t div(int, int);
__intrinsic __nounwind void free(void *);
__intrinsic __nounwind long labs(long);
__intrinsic __nounwind ldiv_t ldiv(long, long);
    #pragma language=save
    #pragma language=extended
    __intrinsic __nounwind long long llabs(long long);
    __intrinsic __nounwind lldiv_t lldiv(long long, long long);
    #pragma language=restore
__intrinsic __nounwind void * malloc(size_t);
__intrinsic __nounwind int mblen(const char *, size_t);
__intrinsic __nounwind size_t mbstowcs(wchar_t *, const char *, size_t);
__intrinsic __nounwind int mbtowc(wchar_t *, const char *, size_t);
__intrinsic __nounwind int rand(void);
__intrinsic __nounwind void srand(unsigned int);
__intrinsic __nounwind void * realloc(void *, size_t);
__intrinsic __nounwind long strtol(const char *, char **, int);
__intrinsic __nounwind unsigned long strtoul(const char *, char **, int);
__intrinsic __nounwind size_t wcstombs(char *, const wchar_t *, size_t);
__intrinsic __nounwind int wctomb(char *, wchar_t);
    #pragma language=save
    #pragma language=extended
    __intrinsic __nounwind long long strtoll(const char *, char **, int);
    __intrinsic __nounwind unsigned long long strtoull(const char *, char **, int);
    #pragma language=restore





__intrinsic __nounwind unsigned long __iar_Stoul(const char *, char **, int);
__intrinsic __nounwind float __iar_Stof(const char *, char **, long);
__intrinsic __nounwind double __iar_Stod(const char *, char **, long);
__intrinsic __nounwind long double __iar_Stold(const char *, char **, long);
__intrinsic __nounwind long __iar_Stolx(const char *, char **, int, int *);
__intrinsic __nounwind unsigned long __iar_Stoulx(const char *, char **, int, int *);
__intrinsic __nounwind float __iar_Stofx(const char *, char **, long, int *);
__intrinsic __nounwind double __iar_Stodx(const char *, char **, long, int *);
__intrinsic __nounwind long double __iar_Stoldx(const char *, char **, long, int *);
  #pragma language=save
  #pragma language=extended
  __intrinsic __nounwind _Longlong __iar_Stoll(const char *, char **, int);
  __intrinsic __nounwind _ULonglong __iar_Stoull(const char *, char **, int);
  __intrinsic __nounwind _Longlong __iar_Stollx(const char *, char **, int, int *);
  __intrinsic __nounwind _ULonglong __iar_Stoullx(const char *, char **, int, int *);
  #pragma language=restore


typedef int _Cmpfun(const void *, const void *);

__intrinsic void * bsearch(const void *, const void *, size_t,
                                      size_t, _Cmpfun *);
__intrinsic void qsort(void *, size_t, size_t, _Cmpfun *);
__intrinsic void __qsortbbl(void *, size_t, size_t, _Cmpfun *);
__intrinsic __nounwind double atof(const char *);
__intrinsic __nounwind int atoi(const char *);
__intrinsic __nounwind long atol(const char *);
    #pragma language=save
    #pragma language=extended
    __intrinsic __nounwind long long atoll(const char *);
    #pragma language=restore
  __intrinsic __nounwind float strtof(const char *, char **);
  __intrinsic __nounwind long double strtold(const char *, char **);
__intrinsic __nounwind double strtod(const char *, char **);
__intrinsic __nounwind size_t __iar_Mbcurmax(void);

__intrinsic __nounwind int __iar_DLib_library_version(void);




  
  typedef void _Atexfun(void);
  

                 
    #pragma inline=no_body
    double atof(const char *_S)
    {       
      return (__iar_Stod(_S, 0, 0));
    }

    #pragma inline=no_body
    int atoi(const char *_S)
    {       
      return ((int)__iar_Stoul(_S, 0, 10));
    }

    #pragma inline=no_body
    long atol(const char *_S)
    {       
      return ((long)__iar_Stoul(_S, 0, 10));
    }

        #pragma language=save
        #pragma language=extended
        #pragma inline=no_body
        long long atoll(const char *_S)
        {       
            return ((long long)__iar_Stoull(_S, 0, 10));
        }
        #pragma language=restore

    #pragma inline=no_body
    double strtod(const char * _S, char ** _Endptr)
    {       
      return (__iar_Stod(_S, _Endptr, 0));
    }

      #pragma inline=no_body
      float strtof(const char * _S, char ** _Endptr)
      {       
        return (__iar_Stof(_S, _Endptr, 0));
      }

      #pragma inline=no_body
      long double strtold(const char * _S, char ** _Endptr)
      {       
        return (__iar_Stold(_S, _Endptr, 0));
      }

    #pragma inline=no_body
    long strtol(const char * _S, char ** _Endptr, 
                int _Base)
    {       
      return (__iar_Stolx(_S, _Endptr, _Base, 0));
    }

    #pragma inline=no_body
    unsigned long strtoul(const char * _S, char ** _Endptr, 
                          int _Base)
    {       
      return (__iar_Stoul(_S, _Endptr, _Base));
    }

        #pragma language=save
        #pragma language=extended
        #pragma inline=no_body
        long long strtoll(const char * _S, char ** _Endptr,
                          int _Base)
        {       
            return (__iar_Stoll(_S, _Endptr, _Base));
        }

        #pragma inline=no_body
        unsigned long long strtoull(const char * _S, 
                                    char ** _Endptr, int _Base)
        {       
            return (__iar_Stoull(_S, _Endptr, _Base));
        }
        #pragma language=restore


  #pragma inline=no_body
  int abs(int i)
  {       
    return (i < 0 ? -i : i);
  }

  #pragma inline=no_body
  long labs(long i)
  {       
    return (i < 0 ? -i : i);
  }

      #pragma language=save
      #pragma language=extended
      #pragma inline=no_body
      long long llabs(long long i)
      {       
        return (i < 0 ? -i : i);
      }
      #pragma language=restore








 







 

 
#pragma diag_suppress = Pe076


__intrinsic __nounwind int __iar_Atthreadexit(void (*)(void));
__intrinsic __nounwind void __iar_Destroytls(void);














 


  


 

  



 





 


  #pragma system_include




 
 

  #pragma system_include

 
 

 

  #pragma system_include






 















 





 
 

  #pragma system_include

 
 

 

  #pragma system_include






 















 




 
 






 

 
#pragma rtmodel="__dlib_file_descriptor","0"

 


                 



                 
typedef _Mbstatet mbstate_t;

struct tm;


  typedef _Wintt wint_t;


                 

__intrinsic __nounwind wint_t getwchar(void);
__intrinsic __nounwind wint_t __ungetwchar(wint_t);
__intrinsic __nounwind wint_t putwchar(wchar_t);
__intrinsic __nounwind int swprintf(wchar_t *, size_t, 
                          const wchar_t *, ...);
__intrinsic __nounwind int swscanf(const wchar_t *,
                         const wchar_t *, ...);
__intrinsic __nounwind int vswprintf(wchar_t *, size_t,
                           const wchar_t *, __Va_list);
__intrinsic __nounwind int vwprintf(const wchar_t *, __Va_list);
  __intrinsic __nounwind int vswscanf(const wchar_t *, const wchar_t *,
                            __Va_list);
  __intrinsic __nounwind int vwscanf(const wchar_t *, __Va_list);
__intrinsic __nounwind int wprintf(const wchar_t *, ...);
__intrinsic __nounwind int wscanf(const wchar_t *, ...);

                 
__intrinsic __nounwind size_t mbrlen(const char *, size_t,
                           mbstate_t *);
__intrinsic __nounwind size_t mbrtowc(wchar_t *, const char *, size_t,
                            mbstate_t *);
__intrinsic __nounwind size_t mbsrtowcs(wchar_t *, const char **,
                              size_t, mbstate_t *);
__intrinsic __nounwind int mbsinit(const mbstate_t *);
__intrinsic __nounwind size_t wcrtomb(char *, wchar_t, mbstate_t *);
__intrinsic __nounwind size_t wcsrtombs(char *, const wchar_t **,
                              size_t, mbstate_t *);
__intrinsic __nounwind long wcstol(const wchar_t *, wchar_t **, int);
__intrinsic __nounwind unsigned long wcstoul(const wchar_t *,
                                   wchar_t **, int);

    #pragma language=save
    #pragma language=extended
    __intrinsic __nounwind _Longlong wcstoll(const wchar_t *, 
                                   wchar_t **, int);
    __intrinsic __nounwind _ULonglong wcstoull(const wchar_t *, 
                                     wchar_t **, int);
    #pragma language=restore

                 
__intrinsic __nounwind wchar_t * wcscat(wchar_t *, const wchar_t *);
__intrinsic __nounwind int wcscmp(const wchar_t *, const wchar_t *);
__intrinsic __nounwind int wcscoll(const wchar_t *, const wchar_t *);
__intrinsic __nounwind wchar_t * wcscpy(wchar_t *, const wchar_t *);
__intrinsic __nounwind size_t wcscspn(const wchar_t *, const wchar_t *);
__intrinsic __nounwind size_t wcslen(const wchar_t *);
__intrinsic __nounwind wchar_t * wcsncat(wchar_t *, const wchar_t *, 
                               size_t);
__intrinsic __nounwind int wcsncmp(const wchar_t *, const wchar_t *, size_t);
__intrinsic __nounwind wchar_t * wcsncpy(wchar_t *, const wchar_t *,
                               size_t);
__intrinsic __nounwind size_t wcsspn(const wchar_t *, const wchar_t *);
__intrinsic __nounwind wchar_t * wcstok(wchar_t *, const wchar_t *,
                              wchar_t **);
__intrinsic __nounwind size_t wcsxfrm(wchar_t *, const wchar_t *, 
                            size_t);
__intrinsic __nounwind int wmemcmp(const wchar_t *, const wchar_t *, size_t);
__intrinsic __nounwind wchar_t * wmemcpy(wchar_t *, const wchar_t *, 
                               size_t);
__intrinsic __nounwind wchar_t * wmemmove(wchar_t *, const wchar_t *, size_t);
__intrinsic __nounwind wchar_t * wmemset(wchar_t *, wchar_t, size_t);

                 
__intrinsic __nounwind size_t wcsftime(wchar_t *, size_t,
                             const wchar_t *, 
                             const struct tm *);


__intrinsic __nounwind wint_t btowc(int);
  __intrinsic __nounwind float wcstof(const wchar_t *, wchar_t **);
  __intrinsic __nounwind long double wcstold(const wchar_t *,
                                   wchar_t **);
__intrinsic __nounwind double wcstod(const wchar_t *, wchar_t **);
__intrinsic __nounwind int wctob(wint_t);

__intrinsic __nounwind wint_t __iar_Btowc(int);
__intrinsic __nounwind int __iar_Wctob(wint_t);
__intrinsic __nounwind double __iar_WStod(const wchar_t *, wchar_t **, long);
__intrinsic __nounwind float __iar_WStof(const wchar_t *, wchar_t **, long);
__intrinsic __nounwind long double __iar_WStold(const wchar_t *, wchar_t **, long);
__intrinsic __nounwind unsigned long __iar_WStoul(const wchar_t *, wchar_t **, int);
__intrinsic __nounwind _Longlong __iar_WStoll(const wchar_t *, wchar_t **, int);
__intrinsic __nounwind _ULonglong __iar_WStoull(const wchar_t *, wchar_t **, int);

__intrinsic __nounwind wchar_t * __iar_Wmemchr(const wchar_t *, wchar_t, size_t);
__intrinsic __nounwind wchar_t * __iar_Wcschr(const wchar_t *, wchar_t);
__intrinsic __nounwind wchar_t * __iar_Wcspbrk(const wchar_t *, const wchar_t *);
__intrinsic __nounwind wchar_t * __iar_Wcsrchr(const wchar_t *, wchar_t);
__intrinsic __nounwind wchar_t * __iar_Wcsstr(const wchar_t *, const wchar_t *);


 

  __intrinsic __nounwind wchar_t * wmemchr(const wchar_t *, wchar_t, size_t);
  __intrinsic __nounwind wchar_t * wcschr(const wchar_t *, wchar_t);
  __intrinsic __nounwind wchar_t * wcspbrk(const wchar_t *, const wchar_t *);
  __intrinsic __nounwind wchar_t * wcsrchr(const wchar_t *, wchar_t);
  __intrinsic __nounwind wchar_t * wcsstr(const wchar_t *, const wchar_t *);

    #pragma inline
    wchar_t * wmemchr(const wchar_t *_S, wchar_t _C, size_t _N)
    {
      return (__iar_Wmemchr(_S, _C, _N));
    }

    #pragma inline
    wchar_t * wcschr(const wchar_t *_S, wchar_t _C)
    {
      return (__iar_Wcschr(_S, _C));
    }

    #pragma inline
    wchar_t * wcspbrk(const wchar_t *_S, const wchar_t *_P)
    {
      return (__iar_Wcspbrk(_S, _P));
    }

    #pragma inline
    wchar_t * wcsrchr(const wchar_t *_S, wchar_t _C)
    {
      return (__iar_Wcsrchr(_S, _C));
    }

    #pragma inline
    wchar_t * wcsstr(const wchar_t *_S, const wchar_t *_P)
    {
      return (__iar_Wcsstr(_S, _P));
    }

  #pragma inline
  wint_t btowc(int _C)
  {        
    return (__iar_Btowc(_C));
  }

    #pragma inline
    float wcstof(const wchar_t *_S,
                 wchar_t **_Endptr)
    {        
      return (__iar_WStof(_S, _Endptr, 0));
    }

    #pragma inline
    long double wcstold(const wchar_t *_S,
                        wchar_t **_Endptr)
    {        
      return (__iar_WStold(_S, _Endptr, 0));
    }

      #pragma language=save
      #pragma language=extended
      #pragma inline
       _Longlong wcstoll(const wchar_t * _S, 
                         wchar_t ** _Endptr, int _Base)
       {
	return (__iar_WStoll(_S, _Endptr, _Base));
       }

      #pragma inline
      _ULonglong wcstoull(const wchar_t * _S, 
                          wchar_t ** _Endptr, int _Base)
      {
	return (__iar_WStoull(_S, _Endptr, _Base));
      }
      #pragma language=restore


  #pragma inline
  double wcstod(const wchar_t *_S,
                wchar_t **_Endptr)
  {        
    return (__iar_WStod(_S, _Endptr, 0));
  }


  #pragma inline
  unsigned long wcstoul(const wchar_t *_S,
                        wchar_t **_Endptr, int _Base)
  {        
    return (__iar_WStoul(_S, _Endptr, _Base));
  }

  #pragma inline
  int wctob(wint_t _Wc)
  {        
    return (__iar_Wctob(_Wc));
  }








 






__intrinsic __nounwind int _LocaleC_toupper(int);
__intrinsic __nounwind int _LocaleC_tolower(int);

__intrinsic __nounwind int _LocaleC_isalpha(int);
__intrinsic __nounwind int _LocaleC_iscntrl(int);
__intrinsic __nounwind int _LocaleC_islower(int);
__intrinsic __nounwind int _LocaleC_ispunct(int);
__intrinsic __nounwind int _LocaleC_isspace(int);
__intrinsic __nounwind int _LocaleC_isupper(int);


__intrinsic __nounwind wint_t _LocaleC_towupper(wint_t);
__intrinsic __nounwind wint_t _LocaleC_towlower(wint_t);

__intrinsic __nounwind int _LocaleC_iswalpha(wint_t);
__intrinsic __nounwind int _LocaleC_iswcntrl(wint_t);
__intrinsic __nounwind int _LocaleC_iswlower(wint_t);
__intrinsic __nounwind int _LocaleC_iswpunct(wint_t);
__intrinsic __nounwind int _LocaleC_iswspace(wint_t);
__intrinsic __nounwind int _LocaleC_iswupper(wint_t);
__intrinsic __nounwind int _LocaleC_iswdigit(wint_t);
__intrinsic __nounwind int _LocaleC_iswxdigit(wint_t);






 

   
  #pragma inline
  int _LocaleC_islower(int _C)
  {
    return (_C>='a' && _C<='z');
  }

  #pragma inline
  int _LocaleC_isupper(int _C)
  {
    return (_C>='A' && _C<='Z');
  }

  #pragma inline
  int _LocaleC_isalpha(int _C)
  {
    return (   _LocaleC_islower(_C)
            || _LocaleC_isupper(_C));
  }

  #pragma inline
  int _LocaleC_iscntrl(int _C)
  {
    return (   (_C>='\x00' && _C<='\x1f')
            || _C=='\x7f');
  }

  #pragma inline
  int _LocaleC_ispunct(int _C)
  {
    return (   (_C>='\x21' && _C<='\x2f')
            || (_C>='\x3a' && _C<='\x40')
            || (_C>='\x5b' && _C<='\x60')
            || (_C>='\x7b' && _C<='\x7e'));
  }

  #pragma inline
  int _LocaleC_isspace(int _C)
  {
    return (   (_C>='\x09' && _C<='\x0d')
            || (_C==' '));
  }

  #pragma inline
  int _LocaleC_tolower(int _C)
  {
    return (_LocaleC_isupper(_C)?_C-'A'+'a':_C);
  }

  #pragma inline
  int _LocaleC_toupper(int _C)
  {
    return (_LocaleC_islower(_C)?_C-'a'+'A':_C);
  }









 
#pragma rtmodel="__dlib_full_locale_support",   "0"




__intrinsic __nounwind int isalnum(int);
__intrinsic __nounwind int isalpha(int);
  __intrinsic __nounwind int isblank(int);
__intrinsic __nounwind int iscntrl(int);
__intrinsic __nounwind int isdigit(int);
__intrinsic __nounwind int isgraph(int);
__intrinsic __nounwind int islower(int);
__intrinsic __nounwind int isprint(int);
__intrinsic __nounwind int ispunct(int);
__intrinsic __nounwind int isspace(int);
__intrinsic __nounwind int isupper(int);
__intrinsic __nounwind int isxdigit(int);
__intrinsic __nounwind int tolower(int);
__intrinsic __nounwind int toupper(int);


 

    #pragma inline
    int isblank(int _C)
    {
      return (   _C == ' '
              || _C == '\t'
              || isspace(_C));
    }

  #pragma inline
  int isdigit(int _C)
  {
    return _C >= '0' && _C <= '9';
  }

  #pragma inline
  int isxdigit(int _C)
  {
    return (   (_C >= 'a' && _C <= 'f')
            || (_C >= 'A' && _C <= 'F')
            || isdigit(_C));
  }

  #pragma inline
  int isalnum(int _C)
  {
    return (   isalpha(_C)
            || isdigit(_C));
  }

  #pragma inline
  int isprint(int _C)
  {
    return (   (_C >= ' ' && _C <= '\x7e')
            || isalpha(_C)
            || ispunct(_C));
  }

  #pragma inline
  int isgraph(int _C)
  {
    return (   _C != ' '
            && isprint(_C));
  }




     
    
    extern int _LocaleC_toupper(int);
    extern int _LocaleC_tolower(int);
    extern int _LocaleC_isalpha(int);
    extern int _LocaleC_iscntrl(int);
    extern int _LocaleC_islower(int);
    extern int _LocaleC_ispunct(int);
    extern int _LocaleC_isspace(int);
    extern int _LocaleC_isupper(int);
    

    #pragma inline
    int toupper(int _C)
    {
      return _LocaleC_toupper(_C);
    }

    #pragma inline
    int tolower(int _C)
    {
      return _LocaleC_tolower(_C);
    }

    #pragma inline
    int isalpha(int _C)
    {
     return _LocaleC_isalpha(_C);
    }

    #pragma inline
    int iscntrl(int _C)
    {
      return _LocaleC_iscntrl(_C);
    }

    #pragma inline
    int islower(int _C)
    {
      return _LocaleC_islower(_C);
    }

    #pragma inline
    int ispunct(int _C)
    {
      return _LocaleC_ispunct(_C);
    }

    #pragma inline
    int isspace(int _C)
    {
      return _LocaleC_isspace(_C);
    }

    #pragma inline
    int isupper(int _C)
    {
      return _LocaleC_isupper(_C);
    }









 
 
 






 
 
 

 


  #pragma system_include











 
 
 

  #pragma system_include

 
 

 

  #pragma system_include






 















 







         




         


         

         

         

         

         

         







 








 


 
 

 

  #pragma system_include






 















 





  #pragma system_include



 



#pragma language=save
#pragma language=extended

__intrinsic void    __no_operation(void);

__intrinsic void    __disable_interrupt(void);
__intrinsic void    __enable_interrupt(void);

typedef unsigned long __istate_t;

__intrinsic __istate_t __get_interrupt_state(void);
__intrinsic void __set_interrupt_state(__istate_t);


 
__intrinsic unsigned long __get_PRIMASK( void );
__intrinsic void          __set_PRIMASK( unsigned long );
__intrinsic unsigned long __get_CONTROL( void );
__intrinsic void          __set_CONTROL( unsigned long );


 

__intrinsic unsigned long __SWP( unsigned long, unsigned long * );
__intrinsic unsigned char __SWPB( unsigned char, unsigned char * );

typedef unsigned long __ul;


 
__intrinsic void          __MCR( unsigned __constrange(0,15) coproc, unsigned __constrange(0,8) opcode_1, __ul src,
                                 unsigned __constrange(0,15) CRn, unsigned __constrange(0,15) CRm, unsigned __constrange(0,8) opcode_2 );
__intrinsic unsigned long __MRC( unsigned __constrange(0,15) coproc, unsigned __constrange(0,8) opcode_1, 
                                 unsigned __constrange(0,15) CRn, unsigned __constrange(0,15) CRm, unsigned __constrange(0,8) opcode_2 );
__intrinsic void          __MCR2( unsigned __constrange(0,15) coproc, unsigned __constrange(0,8) opcode_1, __ul src,
                                  unsigned __constrange(0,15) CRn, unsigned __constrange(0,15) CRm, unsigned __constrange(0,8) opcode_2 );
__intrinsic unsigned long __MRC2( unsigned __constrange(0,15) coproc, unsigned __constrange(0,8) opcode_1, 
                                  unsigned __constrange(0,15) CRn, unsigned __constrange(0,15) CRm, unsigned __constrange(0,8) opcode_2 );

 
__intrinsic void __LDC( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul const *src);
__intrinsic void __LDCL( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul const *src);
__intrinsic void __LDC2( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul const *src);
__intrinsic void __LDC2L( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul const *src);

 
__intrinsic void __STC( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul *dst);
__intrinsic void __STCL( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul *dst);
__intrinsic void __STC2( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul *dst);
__intrinsic void __STC2L( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul *dst);

 
__intrinsic void __LDC_noidx( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul const *src,
                              unsigned __constrange(0,255) option);

__intrinsic void __LDCL_noidx( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul const *src,
                               unsigned __constrange(0,255) option);

__intrinsic void __LDC2_noidx( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul const *src,
                               unsigned __constrange(0,255) option);

__intrinsic void __LDC2L_noidx( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul const *src,
                                unsigned __constrange(0,255) option);

 
__intrinsic void __STC_noidx( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul *dst,
                              unsigned __constrange(0,255) option);

__intrinsic void __STCL_noidx( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul *dst,
                               unsigned __constrange(0,255) option);

__intrinsic void __STC2_noidx( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul *dst,
                               unsigned __constrange(0,255) option);

__intrinsic void __STC2L_noidx( unsigned __constrange(0,15) coproc, unsigned __constrange(0,15) CRn, __ul *dst,
                                unsigned __constrange(0,255) option);

 
__intrinsic unsigned long __get_APSR( void );
__intrinsic void          __set_APSR( unsigned long );

 
__intrinsic unsigned char __CLZ( unsigned long );

 

__intrinsic int         __QCFlag( void );
__intrinsic void __reset_QC_flag( void );

__intrinsic signed long __SMUL( signed short, signed short );

 
__intrinsic unsigned long __REV( unsigned long );
__intrinsic signed long __REVSH( short );

__intrinsic unsigned long __LDREX( unsigned long * );
__intrinsic unsigned long __STREX( unsigned long, unsigned long * );



 
__intrinsic void __DMB(void);
__intrinsic void __DSB(void);
__intrinsic void __ISB(void);


#pragma language=restore


 
 

 














 


 

  #pragma system_include

 
 

 

  #pragma system_include






 















 











__intrinsic __nounwind void __aeabi_assert(char const *, char const *, int);
__intrinsic __nounwind int  __iar_ReportAssert(const char *, const char *,
                                    const char *, const char *);
__intrinsic __nounwind void __iar_EmptyStepPoint(void);
__intrinsic __nounwind void __iar_PrintAssert(const char*);




    
 











 












 












 










 




 


  #pragma system_include

#pragma language=save
#pragma language=extended

 




 



 
typedef struct
{
  unsigned char no0:1;
  unsigned char no1:1;
  unsigned char no2:1;
  unsigned char no3:1;
  unsigned char no4:1;
  unsigned char no5:1;
  unsigned char no6:1;
  unsigned char no7:1;
} __BITS8;

typedef struct
{
  unsigned short no0:1;
  unsigned short no1:1;
  unsigned short no2:1;
  unsigned short no3:1;
  unsigned short no4:1;
  unsigned short no5:1;
  unsigned short no6:1;
  unsigned short no7:1;
  unsigned short no8:1;
  unsigned short no9:1;
  unsigned short no10:1;
  unsigned short no11:1;
  unsigned short no12:1;
  unsigned short no13:1;
  unsigned short no14:1;
  unsigned short no15:1;
} __BITS16;

typedef struct
{
  unsigned long no0:1;
  unsigned long no1:1;
  unsigned long no2:1;
  unsigned long no3:1;
  unsigned long no4:1;
  unsigned long no5:1;
  unsigned long no6:1;
  unsigned long no7:1;
  unsigned long no8:1;
  unsigned long no9:1;
  unsigned long no10:1;
  unsigned long no11:1;
  unsigned long no12:1;
  unsigned long no13:1;
  unsigned long no14:1;
  unsigned long no15:1;
  unsigned long no16:1;
  unsigned long no17:1;
  unsigned long no18:1;
  unsigned long no19:1;
  unsigned long no20:1;
  unsigned long no21:1;
  unsigned long no22:1;
  unsigned long no23:1;
  unsigned long no24:1;
  unsigned long no25:1;
  unsigned long no26:1;
  unsigned long no27:1;
  unsigned long no28:1;
  unsigned long no29:1;
  unsigned long no30:1;
  unsigned long no31:1;
} __BITS32;




 







 



#pragma language=restore










 

 

#pragma system_include


 
typedef struct {
  unsigned long  ENABLE         : 1;
  unsigned long  TICKINT        : 1;
  unsigned long  CLKSOURCE      : 1;
  unsigned long                 :13;
  unsigned long  COUNTFLAG      : 1;
  unsigned long                 :15;
} __systickcsr_bits;

 
typedef struct {
  unsigned long  RELOAD         :24;
  unsigned long                 : 8;
} __systickrvr_bits;

 
typedef struct {
  unsigned long  CURRENT        :24;
  unsigned long                 : 8;
} __systickcvr_bits;

 
typedef struct {
  unsigned long  TENMS          :24;
  unsigned long                 : 6;
  unsigned long  SKEW           : 1;
  unsigned long  NOREF          : 1;
} __systickcalvr_bits;

 
typedef struct {
  unsigned long  SETENA0        : 1;
  unsigned long  SETENA1        : 1;
  unsigned long  SETENA2        : 1;
  unsigned long  SETENA3        : 1;
  unsigned long  SETENA4        : 1;
  unsigned long  SETENA5        : 1;
  unsigned long  SETENA6        : 1;
  unsigned long  SETENA7        : 1;
  unsigned long  SETENA8        : 1;
  unsigned long  SETENA9        : 1;
  unsigned long  SETENA10       : 1;
  unsigned long  SETENA11       : 1;
  unsigned long  SETENA12       : 1;
  unsigned long  SETENA13       : 1;
  unsigned long  SETENA14       : 1;
  unsigned long  SETENA15       : 1;
  unsigned long  SETENA16       : 1;
  unsigned long  SETENA17       : 1;
  unsigned long  SETENA18       : 1;
  unsigned long  SETENA19       : 1;
  unsigned long  SETENA20       : 1;
  unsigned long  SETENA21       : 1;
  unsigned long  SETENA22       : 1;
  unsigned long  SETENA23       : 1;
  unsigned long  SETENA24       : 1;
  unsigned long  SETENA25       : 1;
  unsigned long  SETENA26       : 1;
  unsigned long  SETENA27       : 1;
  unsigned long  SETENA28       : 1;
  unsigned long  SETENA29       : 1;
  unsigned long  SETENA30       : 1;
  unsigned long  SETENA31       : 1;
} __setena0_bits;

 
typedef struct {
  unsigned long  CLRENA0        : 1;
  unsigned long  CLRENA1        : 1;
  unsigned long  CLRENA2        : 1;
  unsigned long  CLRENA3        : 1;
  unsigned long  CLRENA4        : 1;
  unsigned long  CLRENA5        : 1;
  unsigned long  CLRENA6        : 1;
  unsigned long  CLRENA7        : 1;
  unsigned long  CLRENA8        : 1;
  unsigned long  CLRENA9        : 1;
  unsigned long  CLRENA10       : 1;
  unsigned long  CLRENA11       : 1;
  unsigned long  CLRENA12       : 1;
  unsigned long  CLRENA13       : 1;
  unsigned long  CLRENA14       : 1;
  unsigned long  CLRENA15       : 1;
  unsigned long  CLRENA16       : 1;
  unsigned long  CLRENA17       : 1;
  unsigned long  CLRENA18       : 1;
  unsigned long  CLRENA19       : 1;
  unsigned long  CLRENA20       : 1;
  unsigned long  CLRENA21       : 1;
  unsigned long  CLRENA22       : 1;
  unsigned long  CLRENA23       : 1;
  unsigned long  CLRENA24       : 1;
  unsigned long  CLRENA25       : 1;
  unsigned long  CLRENA26       : 1;
  unsigned long  CLRENA27       : 1;
  unsigned long  CLRENA28       : 1;
  unsigned long  CLRENA29       : 1;
  unsigned long  CLRENA30       : 1;
  unsigned long  CLRENA31       : 1;
} __clrena0_bits;

 
typedef struct {
  unsigned long  SETPEND0       : 1;
  unsigned long  SETPEND1       : 1;
  unsigned long  SETPEND2       : 1;
  unsigned long  SETPEND3       : 1;
  unsigned long  SETPEND4       : 1;
  unsigned long  SETPEND5       : 1;
  unsigned long  SETPEND6       : 1;
  unsigned long  SETPEND7       : 1;
  unsigned long  SETPEND8       : 1;
  unsigned long  SETPEND9       : 1;
  unsigned long  SETPEND10      : 1;
  unsigned long  SETPEND11      : 1;
  unsigned long  SETPEND12      : 1;
  unsigned long  SETPEND13      : 1;
  unsigned long  SETPEND14      : 1;
  unsigned long  SETPEND15      : 1;
  unsigned long  SETPEND16      : 1;
  unsigned long  SETPEND17      : 1;
  unsigned long  SETPEND18      : 1;
  unsigned long  SETPEND19      : 1;
  unsigned long  SETPEND20      : 1;
  unsigned long  SETPEND21      : 1;
  unsigned long  SETPEND22      : 1;
  unsigned long  SETPEND23      : 1;
  unsigned long  SETPEND24      : 1;
  unsigned long  SETPEND25      : 1;
  unsigned long  SETPEND26      : 1;
  unsigned long  SETPEND27      : 1;
  unsigned long  SETPEND28      : 1;
  unsigned long  SETPEND29      : 1;
  unsigned long  SETPEND30      : 1;
  unsigned long  SETPEND31      : 1;
} __setpend0_bits;

 
typedef struct {
  unsigned long  CLRPEND0       : 1;
  unsigned long  CLRPEND1       : 1;
  unsigned long  CLRPEND2       : 1;
  unsigned long  CLRPEND3       : 1;
  unsigned long  CLRPEND4       : 1;
  unsigned long  CLRPEND5       : 1;
  unsigned long  CLRPEND6       : 1;
  unsigned long  CLRPEND7       : 1;
  unsigned long  CLRPEND8       : 1;
  unsigned long  CLRPEND9       : 1;
  unsigned long  CLRPEND10      : 1;
  unsigned long  CLRPEND11      : 1;
  unsigned long  CLRPEND12      : 1;
  unsigned long  CLRPEND13      : 1;
  unsigned long  CLRPEND14      : 1;
  unsigned long  CLRPEND15      : 1;
  unsigned long  CLRPEND16      : 1;
  unsigned long  CLRPEND17      : 1;
  unsigned long  CLRPEND18      : 1;
  unsigned long  CLRPEND19      : 1;
  unsigned long  CLRPEND20      : 1;
  unsigned long  CLRPEND21      : 1;
  unsigned long  CLRPEND22      : 1;
  unsigned long  CLRPEND23      : 1;
  unsigned long  CLRPEND24      : 1;
  unsigned long  CLRPEND25      : 1;
  unsigned long  CLRPEND26      : 1;
  unsigned long  CLRPEND27      : 1;
  unsigned long  CLRPEND28      : 1;
  unsigned long  CLRPEND29      : 1;
  unsigned long  CLRPEND30      : 1;
  unsigned long  CLRPEND31      : 1;
} __clrpend0_bits;

 
typedef struct {
  unsigned long  PRI_0          : 8;
  unsigned long  PRI_1          : 8;
  unsigned long  PRI_2          : 8;
  unsigned long  PRI_3          : 8;
} __pri0_bits;

 
typedef struct {
  unsigned long  PRI_4          : 8;
  unsigned long  PRI_5          : 8;
  unsigned long  PRI_6          : 8;
  unsigned long  PRI_7          : 8;
} __pri1_bits;

 
typedef struct {
  unsigned long  PRI_8          : 8;
  unsigned long  PRI_9          : 8;
  unsigned long  PRI_10         : 8;
  unsigned long  PRI_11         : 8;
} __pri2_bits;

 
typedef struct {
  unsigned long  PRI_12         : 8;
  unsigned long  PRI_13         : 8;
  unsigned long  PRI_14         : 8;
  unsigned long  PRI_15         : 8;
} __pri3_bits;

 
typedef struct {
  unsigned long  PRI_16         : 8;
  unsigned long  PRI_17         : 8;
  unsigned long  PRI_18         : 8;
  unsigned long  PRI_19         : 8;
} __pri4_bits;

 
typedef struct {
  unsigned long  PRI_20         : 8;
  unsigned long  PRI_21         : 8;
  unsigned long  PRI_22         : 8;
  unsigned long  PRI_23         : 8;
} __pri5_bits;

 
typedef struct {
  unsigned long  PRI_24         : 8;
  unsigned long  PRI_25         : 8;
  unsigned long  PRI_26         : 8;
  unsigned long  PRI_27         : 8;
} __pri6_bits;

 
typedef struct {
  unsigned long  PRI_28         : 8;
  unsigned long  PRI_29         : 8;
  unsigned long  PRI_30         : 8;
  unsigned long  PRI_31         : 8;
} __pri7_bits;

 
typedef struct {
  unsigned long  REVISION       : 4;
  unsigned long  PARTNO         :12;
  unsigned long  CONSTANT       : 4;
  unsigned long  VARIANT        : 4;
  unsigned long  IMPLEMENTER    : 8;
} __cpuidbr_bits;

 
typedef struct {
  unsigned long  VECTACTIVE     : 6;
  unsigned long                 : 6;
  unsigned long  VECTPENDING    : 6;
  unsigned long                 : 4;
  unsigned long  ISRPENDING     : 1;
  unsigned long                 : 2;
  unsigned long  PENDSTCLR      : 1;
  unsigned long  PENDSTSET      : 1;
  unsigned long  PENDSVCLR      : 1;
  unsigned long  PENDSVSET      : 1;
  unsigned long                 : 2;
  unsigned long  NMIPENDSET     : 1;
} __icsr_bits;

 
typedef struct {
  unsigned long                 : 1;
  unsigned long  VECTCLRACTIVE  : 1;
  unsigned long  SYSRESETREQ    : 1;
  unsigned long                 :12;
  unsigned long  ENDIANESS      : 1;
  unsigned long  VECTKEY        :16;
} __aircr_bits;

 
typedef struct {
  unsigned long                 : 1;
  unsigned long  SLEEPONEXIT    : 1;
  unsigned long  SLEEPDEEP      : 1;
  unsigned long                 : 1;
  unsigned long  SEVONPEND      : 1;
  unsigned long                 :27;
} __scr_bits;

 
typedef struct {
  unsigned long                 : 3;
  unsigned long  UNALIGN_TRP    : 1;
  unsigned long                 : 4;
  unsigned long  STKALIGN       : 1;
  unsigned long                 :23;
} __ccr_bits;

 
typedef struct {
  unsigned long                 :24;
  unsigned long  PRI_11         : 8;
} __shpr2_bits;

 
typedef struct {
  unsigned long                 :16;
  unsigned long  PRI_14         : 8;
  unsigned long  PRI_15         : 8;
} __shpr3_bits;

 
typedef struct {
  unsigned long  MAP            : 2;
  unsigned long                 :30;
} __sysmemremap_bits;

 
typedef struct {
  unsigned long  SSP0_RST_N     : 1;
  unsigned long  I2C_RST_N      : 1;
  unsigned long  SSP1_RST_N     : 1;
  unsigned long                 :29;
} __presetctrl_bits;

 
typedef struct {
  unsigned long  MSEL           : 5;
  unsigned long  PSEL           : 2;
  unsigned long                 :25;
} __pllctrl_bits;

 
typedef struct {
  unsigned long  LOCK           : 1;
  unsigned long                 :31;
} __pllstat_bits;

 
typedef struct {
  unsigned long  BYPASS         : 1;
  unsigned long  FREQRANGE      : 1;
  unsigned long                 :30;
} __sysosccltrl_bits;

 
typedef struct {
  unsigned long  DIVSEL         : 5;
  unsigned long  FREQSEL        : 4;
  unsigned long                 :23;
} __wdtoscctrl_bits;

 
typedef struct {
  unsigned long  TRIM           : 8;
  unsigned long                 :24;
} __ircctrl_bits;

 
typedef struct {
  unsigned long  POR            : 1;
  unsigned long  EXTRST         : 1;
  unsigned long  WDT            : 1;
  unsigned long  BOD            : 1;
  unsigned long  SYSRST         : 1;
  unsigned long                 :27;
} __sysresstat_bits;

 
 
 
 
typedef struct {
  unsigned long  SEL            : 2;
  unsigned long                 :30;
} __clksel_bits;

 
 
 
 
typedef struct {
  unsigned long  ENA            : 1;
  unsigned long                 :31;
} __clkuen_bits;

 
 
 
 
 
typedef struct {
  unsigned long  DIV            : 8;
  unsigned long                 :24;
} __clkdiv_bits;

 
typedef struct {
  unsigned long  SYS            : 1;
  unsigned long  ROM            : 1;
  unsigned long  RAM            : 1;
  unsigned long  FLASHREG       : 1;
  unsigned long  FLASHARRAY     : 1;
  unsigned long  I2C            : 1;
  unsigned long  GPIO           : 1;
  unsigned long  CT16B0         : 1;
  unsigned long  CT16B1         : 1;
  unsigned long  CT32B0         : 1;
  unsigned long  CT32B1         : 1;
  unsigned long  SSP0           : 1;
  unsigned long  UART           : 1;
  unsigned long  ADC            : 1;
  unsigned long                 : 1;
  unsigned long  WDT            : 1;
  unsigned long  IOCON          : 1;
  unsigned long                 : 1;
  unsigned long  SSP1           : 1;
  unsigned long                 :13;
} __sysahbclkctrl_bits;

 
typedef struct {
  unsigned long  CAPPIO0_0      : 1;
  unsigned long  CAPPIO0_1      : 1;
  unsigned long  CAPPIO0_2      : 1;
  unsigned long  CAPPIO0_3      : 1;
  unsigned long  CAPPIO0_4      : 1;
  unsigned long  CAPPIO0_5      : 1;
  unsigned long  CAPPIO0_6      : 1;
  unsigned long  CAPPIO0_7      : 1;
  unsigned long  CAPPIO0_8      : 1;
  unsigned long  CAPPIO0_9      : 1;
  unsigned long  CAPPIO0_10     : 1;
  unsigned long  CAPPIO0_11     : 1;
  unsigned long  CAPPIO1_0      : 1;
  unsigned long  CAPPIO1_1      : 1;
  unsigned long  CAPPIO1_2      : 1;
  unsigned long  CAPPIO1_3      : 1;
  unsigned long  CAPPIO1_4      : 1;
  unsigned long  CAPPIO1_5      : 1;
  unsigned long  CAPPIO1_6      : 1;
  unsigned long  CAPPIO1_7      : 1;
  unsigned long  CAPPIO1_8      : 1;
  unsigned long  CAPPIO1_9      : 1;
  unsigned long  CAPPIO1_10     : 1;
  unsigned long  CAPPIO1_11     : 1;
  unsigned long  CAPPIO2_0      : 1;
  unsigned long  CAPPIO2_1      : 1;
  unsigned long  CAPPIO2_2      : 1;
  unsigned long  CAPPIO2_3      : 1;
  unsigned long  CAPPIO2_4      : 1;
  unsigned long  CAPPIO2_5      : 1;
  unsigned long  CAPPIO2_6      : 1;
  unsigned long  CAPPIO2_7      : 1;
} __pioporcap0_bits;

 
typedef struct {
  unsigned long  CAPPIO2_8      : 1;
  unsigned long  CAPPIO2_9      : 1;
  unsigned long  CAPPIO2_10     : 1;
  unsigned long  CAPPIO2_11     : 1;
  unsigned long  CAPPIO3_0      : 1;
  unsigned long  CAPPIO3_1      : 1;
  unsigned long  CAPPIO3_2      : 1;
  unsigned long  CAPPIO3_3      : 1;
  unsigned long  CAPPIO3_4      : 1;
  unsigned long  CAPPIO3_5      : 1;
  unsigned long                 :22;
} __pioporcap1_bits;

 
typedef struct {
  unsigned long  BODRSTLEV      : 2;
  unsigned long  BODINTVAL      : 2;
  unsigned long  BODRSTENA      : 1;
  unsigned long                 :27;
} __bodctrl_bits;

 
typedef struct {
  unsigned long  CAL            :26;
  unsigned long                 : 6;
} __systckcal_bits;

 
typedef struct {
  unsigned long  APRPIO0_0      : 1;
  unsigned long  APRPIO0_1      : 1;
  unsigned long  APRPIO0_2      : 1;
  unsigned long  APRPIO0_3      : 1;
  unsigned long  APRPIO0_4      : 1;
  unsigned long  APRPIO0_5      : 1;
  unsigned long  APRPIO0_6      : 1;
  unsigned long  APRPIO0_7      : 1;
  unsigned long  APRPIO0_8      : 1;
  unsigned long  APRPIO0_9      : 1;
  unsigned long  APRPIO0_10     : 1;
  unsigned long  APRPIO0_11     : 1;
  unsigned long  APRPIO1_0      : 1;
  unsigned long                 :19;
} __start_apr_p0_bits;

 
typedef struct {
  unsigned long  ERPIO0_0       : 1;
  unsigned long  ERPIO0_1       : 1;
  unsigned long  ERPIO0_2       : 1;
  unsigned long  ERPIO0_3       : 1;
  unsigned long  ERPIO0_4       : 1;
  unsigned long  ERPIO0_5       : 1;
  unsigned long  ERPIO0_6       : 1;
  unsigned long  ERPIO0_7       : 1;
  unsigned long  ERPIO0_8       : 1;
  unsigned long  ERPIO0_9       : 1;
  unsigned long  ERPIO0_10      : 1;
  unsigned long  ERPIO0_11      : 1;
  unsigned long  ERPIO1_0       : 1;
  unsigned long                 :19;
} __start_er_p0_bits;

 
typedef struct {
  unsigned long  RSRPIO0_0      : 1;
  unsigned long  RSRPIO0_1      : 1;
  unsigned long  RSRPIO0_2      : 1;
  unsigned long  RSRPIO0_3      : 1;
  unsigned long  RSRPIO0_4      : 1;
  unsigned long  RSRPIO0_5      : 1;
  unsigned long  RSRPIO0_6      : 1;
  unsigned long  RSRPIO0_7      : 1;
  unsigned long  RSRPIO0_8      : 1;
  unsigned long  RSRPIO0_9      : 1;
  unsigned long  RSRPIO0_10     : 1;
  unsigned long  RSRPIO0_11     : 1;
  unsigned long  RSRPIO1_0      : 1;
  unsigned long                 :19;
} __start_rsr_p0_clr_bits;


 
typedef struct {
  unsigned long  SRPIO0_0       : 1;
  unsigned long  SRPIO0_1       : 1;
  unsigned long  SRPIO0_2       : 1;
  unsigned long  SRPIO0_3       : 1;
  unsigned long  SRPIO0_4       : 1;
  unsigned long  SRPIO0_5       : 1;
  unsigned long  SRPIO0_6       : 1;
  unsigned long  SRPIO0_7       : 1;
  unsigned long  SRPIO0_8       : 1;
  unsigned long  SRPIO0_9       : 1;
  unsigned long  SRPIO0_10      : 1;
  unsigned long  SRPIO0_11      : 1;
  unsigned long  SRPIO1_0       : 1;
  unsigned long                 :19;
} __start_sr_p0_bits;

 
typedef struct {
  unsigned long  				        : 3;
  unsigned long  BOD_PD         : 1;
  unsigned long  								: 2;
  unsigned long  WDTOSC_PD      : 1;
  unsigned long                 :25;
} __pdsleepcfg_bits;

 
 
typedef struct {
  unsigned long  IRCOUT_PD      : 1;
  unsigned long  IRC_PD         : 1;
  unsigned long  FLASH_PD       : 1;
  unsigned long  BOD_PD         : 1;
  unsigned long  ADC_PD         : 1;
  unsigned long  SYSOSC_PD      : 1;
  unsigned long  WDTOSC_PD      : 1;
  unsigned long  SYSPLL_PD      : 1;
  unsigned long                 :24;
} __pdawakecfg_bits;

 
typedef struct {
  unsigned long                 : 1;
  unsigned long  DPDEN          : 1;
  unsigned long                 : 6;
  unsigned long  SLEEPFLAG      : 1;
  unsigned long                 : 2;
  unsigned long  DPDFLAG        : 1;
  unsigned long                 :20;
} __pcon_bits;

 
typedef struct {
  unsigned long                 :10;
  unsigned long  WAKEUPHYS      : 1;
  unsigned long  GPDATA         :21;
} __gpreg4_bits;

 
typedef struct {
  unsigned long  FUNC           : 3;
  unsigned long  MODE           : 2;
  unsigned long  HYS            : 1;
  unsigned long                 :26;
} __iocon_bits;

 
 
typedef struct {
  unsigned long  FUNC           : 3;
  unsigned long                 : 5;
  unsigned long  I2CMODE        : 2;
  unsigned long                 :22;
} __iocon_pio0_4_bits;

 
 
 
 
 
 
 
 
typedef struct {
  unsigned long  FUNC           : 3;
  unsigned long  MODE           : 2;
  unsigned long  HYS            : 1;
  unsigned long                 : 1;
  unsigned long  ADMODE         : 1;
  unsigned long                 :24;
} __iocon_pio1_10_bits;

 
typedef struct {
  unsigned long  SCKLOC         : 2;
  unsigned long                 :30;
} __iocon_sckloc_bits;

 
typedef struct {
  unsigned long  DSRLOC         : 2;
  unsigned long                 :30;
} __iocon_dsrloc_bits;

 
typedef struct {
  unsigned long  DCDLOC         : 2;
  unsigned long                 :30;
} __iocon_dcdloc_bits;

 
typedef struct {
  unsigned long  RILOC          : 2;
  unsigned long                 :30;
} __iocon_riloc_bits;

typedef union{
   
   
   
   
   
   
   
   
   
  struct {
    unsigned long P0_0   : 1;
    unsigned long P0_1   : 1;
    unsigned long P0_2   : 1;
    unsigned long P0_3   : 1;
    unsigned long P0_4   : 1;
    unsigned long P0_5   : 1;
    unsigned long P0_6   : 1;
    unsigned long P0_7   : 1;
    unsigned long P0_8   : 1;
    unsigned long P0_9   : 1;
    unsigned long P0_10  : 1;
    unsigned long P0_11  : 1;
    unsigned long        :20;
  };

  struct
  {
    union
    {
       
       
       
       
       
       
       
       
       
      struct{
        unsigned char  P0_0   : 1;
        unsigned char  P0_1   : 1;
        unsigned char  P0_2   : 1;
        unsigned char  P0_3   : 1;
        unsigned char  P0_4   : 1;
        unsigned char  P0_5   : 1;
        unsigned char  P0_6   : 1;
        unsigned char  P0_7   : 1;
      } __byte0_bit;
      unsigned char __byte0;
    };
    union
    {
       
       
       
       
       
       
       
       
       
      struct{
        unsigned char  P0_0   : 1;
        unsigned char  P0_1   : 1;
        unsigned char  P0_2   : 1;
        unsigned char  P0_3   : 1;
        unsigned char         : 4;
      } __byte1_bit;
      unsigned char __byte1;
    };
    unsigned char __byte2;
    unsigned char __byte3;
  };

  struct
  {
    union
    {
       
       
       
       
       
       
       
       
       
      struct{
        unsigned short P0_0   : 1;
        unsigned short P0_1   : 1;
        unsigned short P0_2   : 1;
        unsigned short P0_3   : 1;
        unsigned short P0_4   : 1;
        unsigned short P0_5   : 1;
        unsigned short P0_6   : 1;
        unsigned short P0_7   : 1;
        unsigned short P0_8   : 1;
        unsigned short P0_9   : 1;
        unsigned short P0_10  : 1;
        unsigned short P0_11  : 1;
        unsigned short        : 4;
      } __shortl_bit;
      unsigned short __shortl;
    };
    unsigned short __shortu;
  };
} __gpio0_bits;

typedef union{
   
   
   
   
   
   
   
   
   
  struct {
    unsigned long P1_0   : 1;
    unsigned long P1_1   : 1;
    unsigned long P1_2   : 1;
    unsigned long P1_3   : 1;
    unsigned long P1_4   : 1;
    unsigned long P1_5   : 1;
    unsigned long P1_6   : 1;
    unsigned long P1_7   : 1;
    unsigned long P1_8   : 1;
    unsigned long P1_9   : 1;
    unsigned long P1_10  : 1;
    unsigned long P1_11  : 1;
    unsigned long        :20;
  };

  struct
  {
    union
    {
       
       
       
       
       
       
       
       
       
      struct{
        unsigned char  P1_0   : 1;
        unsigned char  P1_1   : 1;
        unsigned char  P1_2   : 1;
        unsigned char  P1_3   : 1;
        unsigned char  P1_4   : 1;
        unsigned char  P1_5   : 1;
        unsigned char  P1_6   : 1;
        unsigned char  P1_7   : 1;
      } __byte0_bit;
      unsigned char __byte0;
    };
    union
    {
       
       
       
       
       
       
       
       
       
      struct{
        unsigned char  P1_0   : 1;
        unsigned char  P1_1   : 1;
        unsigned char  P1_2   : 1;
        unsigned char  P1_3   : 1;
        unsigned char         : 4;
      } __byte1_bit;
      unsigned char __byte1;
    };
    unsigned char __byte2;
    unsigned char __byte3;
  };

  struct
  {
    union
    {
       
       
       
       
       
       
       
       
       
      struct{
        unsigned short P1_0   : 1;
        unsigned short P1_1   : 1;
        unsigned short P1_2   : 1;
        unsigned short P1_3   : 1;
        unsigned short P1_4   : 1;
        unsigned short P1_5   : 1;
        unsigned short P1_6   : 1;
        unsigned short P1_7   : 1;
        unsigned short P1_8   : 1;
        unsigned short P1_9   : 1;
        unsigned short P1_10  : 1;
        unsigned short P1_11  : 1;
        unsigned short        : 4;
      } __shortl_bit;
      unsigned short __shortl;
    };
    unsigned short __shortu;
  };
} __gpio1_bits;

typedef union{
   
   
   
   
   
   
   
   
   
  struct {
    unsigned long P2_0   : 1;
    unsigned long P2_1   : 1;
    unsigned long P2_2   : 1;
    unsigned long P2_3   : 1;
    unsigned long P2_4   : 1;
    unsigned long P2_5   : 1;
    unsigned long P2_6   : 1;
    unsigned long P2_7   : 1;
    unsigned long P2_8   : 1;
    unsigned long P2_9   : 1;
    unsigned long P2_10  : 1;
    unsigned long P2_11  : 1;
    unsigned long        :20;
  };

  struct
  {
    union
    {
       
       
       
       
       
       
       
       
       
      struct{
        unsigned char  P2_0   : 1;
        unsigned char  P2_1   : 1;
        unsigned char  P2_2   : 1;
        unsigned char  P2_3   : 1;
        unsigned char  P2_4   : 1;
        unsigned char  P2_5   : 1;
        unsigned char  P2_6   : 1;
        unsigned char  P2_7   : 1;
      } __byte0_bit;
      unsigned char __byte0;
    };
    union
    {
       
       
       
       
       
       
       
       
       
      struct{
        unsigned char  P2_0   : 1;
        unsigned char  P2_1   : 1;
        unsigned char  P2_2   : 1;
        unsigned char  P2_3   : 1;
        unsigned char         : 4;
      } __byte1_bit;
      unsigned char __byte1;
    };
    unsigned char __byte2;
    unsigned char __byte3;
  };

  struct
  {
    union
    {
       
       
       
       
       
       
       
       
       
      struct{
        unsigned short P2_0   : 1;
        unsigned short P2_1   : 1;
        unsigned short P2_2   : 1;
        unsigned short P2_3   : 1;
        unsigned short P2_4   : 1;
        unsigned short P2_5   : 1;
        unsigned short P2_6   : 1;
        unsigned short P2_7   : 1;
        unsigned short P2_8   : 1;
        unsigned short P2_9   : 1;
        unsigned short P2_10  : 1;
        unsigned short P2_11  : 1;
        unsigned short        : 4;
      } __shortl_bit;
      unsigned short __shortl;
    };
    unsigned short __shortu;
  };
} __gpio2_bits;

typedef union{
   
   
   
   
   
   
   
   
   
  struct {
    unsigned long P3_0   : 1;
    unsigned long P3_1   : 1;
    unsigned long P3_2   : 1;
    unsigned long P3_3   : 1;
    unsigned long P3_4   : 1;
    unsigned long P3_5   : 1;
    unsigned long        :26;
  };
  
  struct
  {
    union
    {
       
       
       
       
       
       
       
       
       
      struct{
        unsigned char  P3_0   : 1;
        unsigned char  P3_1   : 1;
        unsigned char  P3_2   : 1;
        unsigned char  P3_3   : 1;
        unsigned char  P3_4   : 1;
        unsigned char  P3_5   : 1;
        unsigned char         : 2;
      } __byte0_bit;
      unsigned char __byte0;
    };

    unsigned char __byte1;
    unsigned char __byte2;
    unsigned char __byte3;
  };

  struct
  {
    union
    {
       
       
       
       
       
       
       
       
       
      struct{
        unsigned short P3_0   : 1;
        unsigned short P3_1   : 1;
        unsigned short P3_2   : 1;
        unsigned short P3_3   : 1;
        unsigned short P3_4   : 1;
        unsigned short P3_5   : 1;
        unsigned short        :10;
      } __shortl_bit;
      unsigned short __shortl;
    };
    unsigned short __shortu;
  };
} __gpio3_bits;

 
typedef struct{
unsigned long RDAIE     : 1;
unsigned long THREIE    : 1;
unsigned long RXLSIE    : 1;
unsigned long           : 5;
unsigned long ABEOINTEN : 1;
unsigned long ABTOINTEN : 1;
unsigned long           :22;
} __uartier_bits;

 
typedef struct{
unsigned char        : 7;
unsigned char  TXEN  : 1;
} __uartter_bits;

 
typedef struct{
unsigned char  DR   : 1;
unsigned char  OE    : 1;
unsigned char  PE    : 1;
unsigned char  FE    : 1;
unsigned char  BI    : 1;
unsigned char  THRE  : 1;
unsigned char  TEMT  : 1;
unsigned char  RXFE  : 1;
} __uartlsr_bits;

 
typedef struct{
unsigned char  WLS   : 2;
unsigned char  SBS   : 1;
unsigned char  PE    : 1;
unsigned char  PS    : 2;
unsigned char  BC    : 1;
unsigned char  DLAB  : 1;
} __uartlcr_bits;

 
typedef struct{
unsigned char  DTR   : 1;
unsigned char  RTS   : 1;
unsigned char        : 2;
unsigned char  LMS   : 1;
unsigned char        : 1;
unsigned char  RTSEN : 1;
unsigned char  CTSEN : 1;
} __uartmcr_bits;

 
typedef union{
   
  struct {
unsigned char  DCTS  : 1;
unsigned char  DDSR  : 1;
unsigned char  TERI  : 1;
unsigned char  DDCD  : 1;
unsigned char  CTS   : 1;
unsigned char  DSR   : 1;
unsigned char  RI    : 1;
unsigned char  DCD   : 1;
  };
   
  struct {
unsigned char  MSR0  : 1;
unsigned char  MSR1  : 1;
unsigned char  MSR2  : 1;
unsigned char  MSR3  : 1;
unsigned char  MSR4  : 1;
unsigned char  MSR5  : 1;
unsigned char  MSR6  : 1;
unsigned char  MSR7  : 1;
  };
} __uartmsr_bits;

 
typedef union {
   
  struct {
unsigned long IP     : 1;
unsigned long IID    : 3;
unsigned long        : 2;
unsigned long IIRFE  : 2;
unsigned long ABEOINT: 1;
unsigned long ABTOINT: 1;
unsigned long        :22;
  };
   
  struct {
unsigned long FCRFE  : 1;
unsigned long RFR    : 1;
unsigned long TFR    : 1;
unsigned long        : 3;
unsigned long RTLS   : 2;
unsigned long        :24;
  };
} __uartfcriir_bits;

 
typedef struct{
unsigned long START        : 1;
unsigned long MODE         : 1;
unsigned long AUTORESTART  : 1;
unsigned long              : 5;
unsigned long ABEOINTCLR   : 1;
unsigned long ABTOINTCLR   : 1;
unsigned long              :22;
} __uartacr_bits;

 
typedef struct{
unsigned long DIVADDVAL  : 4;
unsigned long MULVAL     : 4;
unsigned long            :24;
} __uartfdr_bits;

 
typedef struct{
unsigned long NMMEN      : 1;
unsigned long RXDIS      : 1;
unsigned long AADEN      : 1;
unsigned long SEL        : 1;
unsigned long DCTRL      : 1;
unsigned long OINV       : 1;
unsigned long            :26;
} __u1rs485ctrl_bits;

 
typedef struct{
unsigned long DSS  : 4;
unsigned long FRF  : 2;
unsigned long CPOL : 1;
unsigned long CPHA : 1;
unsigned long SCR  : 8;
unsigned long      :16;
} __sspcr0_bits;

 
typedef struct{
unsigned long LBM  : 1;
unsigned long SSE  : 1;
unsigned long MS   : 1;
unsigned long SOD  : 1;
unsigned long      :28;
} __sspcr1_bits;

 
typedef struct{
unsigned long DATA :16;
unsigned long      :16;
} __sspdr_bits;

 
typedef struct{
unsigned long TFE  : 1;
unsigned long TNF  : 1;
unsigned long RNE  : 1;
unsigned long RFF  : 1;
unsigned long BSY  : 1;
unsigned long      :27;
} __sspsr_bits;

 
typedef struct{
unsigned long CPSDVSR : 8;
unsigned long         :24;
} __sspcpsr_bits;

 
typedef struct{
unsigned long RORIM  : 1;
unsigned long RTIM   : 1;
unsigned long RXIM   : 1;
unsigned long TXIM   : 1;
unsigned long        :28;
} __sspimsc_bits;

 
typedef struct{
unsigned long RORRIS  : 1;
unsigned long RTRIS   : 1;
unsigned long RXRIS   : 1;
unsigned long TXRIS   : 1;
unsigned long         :28;
} __sspris_bits;

 
typedef struct{
unsigned long RORMIS  : 1;
unsigned long RTMIS   : 1;
unsigned long RXMIS   : 1;
unsigned long TXMIS   : 1;
unsigned long         :28;
} __sspmis_bits;

 
typedef struct{
unsigned long RORIC  : 1;
unsigned long RTIC   : 1;
unsigned long        :30;
} __sspicr_bits;

 
typedef struct{
unsigned long       : 2;
unsigned long AA    : 1;
unsigned long SI    : 1;
unsigned long STO   : 1;
unsigned long STA   : 1;
unsigned long I2EN  : 1;
unsigned long       :25;
} __i2conset_bits;

 
typedef struct{
unsigned long        : 2;
unsigned long AAC    : 1;
unsigned long SIC    : 1;
unsigned long        : 1;
unsigned long STAC   : 1;
unsigned long I2ENC  : 1;
unsigned long        :25;
} __i2conclr_bits;

 
typedef struct{
unsigned long STATUS  : 8;
unsigned long         :24;
} __i2stat_bits;

 
typedef struct{
unsigned long DATA  : 8;
unsigned long       :24;
} __i2dat_bits;

 
typedef struct{
unsigned long MM_ENA    : 1;
unsigned long ENA_SCL   : 1;
unsigned long MATCH_ALL : 1;
unsigned long           :29;
} __i2cmmctrl_bits;

 
typedef struct{
unsigned long GC    : 1;
unsigned long ADDR  : 7;
unsigned long       :24;
} __i2adr_bits;

 
typedef struct{
unsigned long       : 1;
unsigned long MASK  : 7;
unsigned long       :24;
} __i2cmask_bits;

 
typedef struct{
unsigned long SCLH   :16;
unsigned long        :16;
} __i2sch_bits;

 
typedef struct{
unsigned long SCLL   :16;
unsigned long        :16;
} __i2scl_bits;

 
 
typedef struct{
unsigned long MR0INT  : 1;
unsigned long MR1INT  : 1;
unsigned long MR2INT  : 1;
unsigned long MR3INT  : 1;
unsigned long CR0INT  : 1;
unsigned long         :27;
} __ir_bits;

 
 
typedef struct{
unsigned long CE  : 1;
unsigned long CR  : 1;
unsigned long     :30;
} __tcr_bits;

 
 
typedef struct{
unsigned long CTM : 2;      
unsigned long CIS : 2;      
unsigned long     :28;
} __ctcr_bits;

 
 
typedef struct{
unsigned long MR0I     : 1;
unsigned long MR0R     : 1;
unsigned long MR0S     : 1;
unsigned long MR1I     : 1;
unsigned long MR1R     : 1;
unsigned long MR1S     : 1;
unsigned long MR2I     : 1;
unsigned long MR2R     : 1;
unsigned long MR2S     : 1;
unsigned long MR3I     : 1;
unsigned long MR3R     : 1;
unsigned long MR3S     : 1;
unsigned long          :20;
} __mcr_bits;

 
 
typedef struct{
unsigned long CAP0RE   : 1;
unsigned long CAP0FE   : 1;
unsigned long CAP0I    : 1;
unsigned long          :29;
} __tccr_bits;

 
 
typedef struct{
unsigned long EM0   : 1;
unsigned long EM1   : 1;
unsigned long EM2   : 1;
unsigned long EM3   : 1;
unsigned long EMC0  : 2;
unsigned long EMC1  : 2;
unsigned long EMC2  : 2;
unsigned long EMC3  : 2;
unsigned long       :20;
} __emr_bits;

 
 
typedef struct{
unsigned long PWM0ENA  : 1;
unsigned long PWM1ENA  : 1;
unsigned long PWM2ENA  : 1;
unsigned long PWM3ENA  : 1;
unsigned long          :28;
} __pwmc_bits;

 
typedef struct{
unsigned long SEL     : 8;
unsigned long CLKDIV  : 8;
unsigned long BURST   : 1;
unsigned long CLKS    : 3;
unsigned long         : 4;
unsigned long START   : 3;
unsigned long EDGE    : 1;
unsigned long         : 4;
} __adcr_bits;

 
typedef struct{
unsigned long         : 6;
unsigned long RESULT  :10;
unsigned long         : 8;
unsigned long CHN     : 3;
unsigned long         : 3;
unsigned long OVERUN  : 1;
unsigned long DONE    : 1;
} __adgdr_bits;

 
typedef struct{
unsigned long DONE0     : 1;
unsigned long DONE1     : 1;
unsigned long DONE2     : 1;
unsigned long DONE3     : 1;
unsigned long DONE4     : 1;
unsigned long DONE5     : 1;
unsigned long DONE6     : 1;
unsigned long DONE7     : 1;
unsigned long OVERRUN0  : 1;
unsigned long OVERRUN1  : 1;
unsigned long OVERRUN2  : 1;
unsigned long OVERRUN3  : 1;
unsigned long OVERRUN4  : 1;
unsigned long OVERRUN5  : 1;
unsigned long OVERRUN6  : 1;
unsigned long OVERRUN7  : 1;
unsigned long ADINT     : 1;
unsigned long           :15;
} __adstat_bits;

 
typedef struct{
unsigned long ADINTEN0  : 1;
unsigned long ADINTEN1  : 1;
unsigned long ADINTEN2  : 1;
unsigned long ADINTEN3  : 1;
unsigned long ADINTEN4  : 1;
unsigned long ADINTEN5  : 1;
unsigned long ADINTEN6  : 1;
unsigned long ADINTEN7  : 1;
unsigned long ADGINTEN  : 1;
unsigned long           :23;
} __adinten_bits;

 
typedef struct{
unsigned long         : 6;
unsigned long RESULT  :10;
unsigned long         :14;
unsigned long OVERUN  : 1;
unsigned long DONE    : 1;
} __addr_bits;

 
typedef struct{
unsigned long WDEN     : 1;
unsigned long WDRESET  : 1;
unsigned long WDTOF    : 1;
unsigned long WDINT    : 1;
unsigned long          :28;
} __wdmod_bits;

 
typedef struct{
unsigned long FEED  : 8;
unsigned long       :24;
} __wdfeed_bits;

 
typedef struct{
unsigned long FLASHTIM  : 2;
unsigned long           :30;
} __flashcfg_bits;

 
typedef struct{
unsigned long START       :17;
unsigned long             :15;
} __fmsstart_bits;

 
typedef struct{
unsigned long STOP        :17;
unsigned long SIG_START   : 1;
unsigned long             :14;
} __fmsstop_bits;

 
typedef struct{
unsigned long             : 2;
unsigned long SIG_DONE    : 1;
unsigned long             :29;
} __fmstat_bits;

 
typedef struct{
unsigned long               : 2;
unsigned long SIG_DONE_CLR  : 1;
unsigned long               :29;
} __fmstatclr_bits;


 





 
volatile __no_init  union { unsigned long SYSTICKCSR; __systickcsr_bits SYSTICKCSR_bit; } @ 0xE000E010;
volatile __no_init  union { unsigned long SYSTICKRVR; __systickrvr_bits SYSTICKRVR_bit; } @ 0xE000E014;
volatile __no_init  union { unsigned long SYSTICKCVR; __systickcvr_bits SYSTICKCVR_bit; } @ 0xE000E018;
volatile __no_init const union { unsigned long SYSTICKCALVR; __systickcalvr_bits SYSTICKCALVR_bit; } @ 0xE000E01C;
volatile __no_init  union { unsigned long SETENA0; __setena0_bits SETENA0_bit; } @ 0xE000E100;
volatile __no_init  union { unsigned long CLRENA0; __clrena0_bits CLRENA0_bit; } @ 0xE000E180;
volatile __no_init  union { unsigned long SETPEND0; __setpend0_bits SETPEND0_bit; } @ 0xE000E200;
volatile __no_init  union { unsigned long CLRPEND0; __clrpend0_bits CLRPEND0_bit; } @ 0xE000E280;
volatile __no_init  union { unsigned long IP0; __pri0_bits IP0_bit; } @ 0xE000E400;
volatile __no_init  union { unsigned long IP1; __pri1_bits IP1_bit; } @ 0xE000E404;
volatile __no_init  union { unsigned long IP2; __pri2_bits IP2_bit; } @ 0xE000E408;
volatile __no_init  union { unsigned long IP3; __pri3_bits IP3_bit; } @ 0xE000E40C;
volatile __no_init  union { unsigned long IP4; __pri4_bits IP4_bit; } @ 0xE000E410;
volatile __no_init  union { unsigned long IP5; __pri5_bits IP5_bit; } @ 0xE000E414;
volatile __no_init  union { unsigned long IP6; __pri6_bits IP6_bit; } @ 0xE000E418;
volatile __no_init  union { unsigned long IP7; __pri7_bits IP7_bit; } @ 0xE000E41C;
volatile __no_init const union { unsigned long CPUIDBR; __cpuidbr_bits CPUIDBR_bit; } @ 0xE000ED00;
volatile __no_init  union { unsigned long ICSR; __icsr_bits ICSR_bit; } @ 0xE000ED04;
volatile __no_init  union { unsigned long AIRCR; __aircr_bits AIRCR_bit; } @ 0xE000ED0C;
volatile __no_init  union { unsigned long SCR; __scr_bits SCR_bit; } @ 0xE000ED10;
volatile __no_init  union { unsigned long CCR; __ccr_bits CCR_bit; } @ 0xE000ED14;
volatile __no_init  union { unsigned long SHPR2; __shpr2_bits SHPR2_bit; } @ 0xE000ED1C;
volatile __no_init  union { unsigned long SHPR3; __shpr3_bits SHPR3_bit; } @ 0xE000ED20;





 
volatile __no_init  union { unsigned long SYSMEMREMAP; __sysmemremap_bits SYSMEMREMAP_bit; } @ 0x40048000;
volatile __no_init  union { unsigned long PRESETCTRL; __presetctrl_bits PRESETCTRL_bit; } @ 0x40048004;
volatile __no_init  union { unsigned long SYSPLLCTRL; __pllctrl_bits SYSPLLCTRL_bit; } @ 0x40048008;
volatile __no_init const union { unsigned long SYSPLLSTAT; __pllstat_bits SYSPLLSTAT_bit; } @ 0x4004800C;
volatile __no_init  union { unsigned long SYSOSCCLTRL; __sysosccltrl_bits SYSOSCCLTRL_bit; } @ 0x40048020;
volatile __no_init  union { unsigned long WDTOSCCTRL; __wdtoscctrl_bits WDTOSCCTRL_bit; } @ 0x40048024;
volatile __no_init  union { unsigned long IRCCTRL; __ircctrl_bits IRCCTRL_bit; } @ 0x40048028;
volatile __no_init const union { unsigned long SYSRESSTAT; __sysresstat_bits SYSRESSTAT_bit; } @ 0x40048030;
volatile __no_init  union { unsigned long SYSPLLCLKSEL; __clksel_bits SYSPLLCLKSEL_bit; } @ 0x40048040;
volatile __no_init  union { unsigned long SYSPLLCLKUEN; __clkuen_bits SYSPLLCLKUEN_bit; } @ 0x40048044;
volatile __no_init  union { unsigned long MAINCLKSEL; __clksel_bits MAINCLKSEL_bit; } @ 0x40048070;
volatile __no_init  union { unsigned long MAINCLKUEN; __clkuen_bits MAINCLKUEN_bit; } @ 0x40048074;
volatile __no_init  union { unsigned long SYSAHBCLKDIV; __clkdiv_bits SYSAHBCLKDIV_bit; } @ 0x40048078;
volatile __no_init  union { unsigned long SYSAHBCLKCTRL; __sysahbclkctrl_bits SYSAHBCLKCTRL_bit; } @ 0x40048080;
volatile __no_init  union { unsigned long SSP0CLKDIV; __clkdiv_bits SSP0CLKDIV_bit; } @ 0x40048094;
volatile __no_init  union { unsigned long UARTCLKDIV; __clkdiv_bits UARTCLKDIV_bit; } @ 0x40048098;
volatile __no_init  union { unsigned long SSP1CLKDIV; __clkdiv_bits SSP1CLKDIV_bit; } @ 0x4004809C;
volatile __no_init  union { unsigned long WDTCLKSEL; __clksel_bits WDTCLKSEL_bit; } @ 0x400480D0;
volatile __no_init  union { unsigned long WDTCLKUEN; __clkuen_bits WDTCLKUEN_bit; } @ 0x400480D4;
volatile __no_init  union { unsigned long WDTCLKDIV; __clkdiv_bits WDTCLKDIV_bit; } @ 0x400480D8;
volatile __no_init  union { unsigned long CLKOUTCLKSEL; __clksel_bits CLKOUTCLKSEL_bit; } @ 0x400480E0;
volatile __no_init  union { unsigned long CLKOUTUEN; __clkuen_bits CLKOUTUEN_bit; } @ 0x400480E4;
volatile __no_init  union { unsigned long CLKOUTDIV; __clkdiv_bits CLKOUTDIV_bit; } @ 0x400480E8;
volatile __no_init const union { unsigned long PIOPORCAP0; __pioporcap0_bits PIOPORCAP0_bit; } @ 0x40048100;
volatile __no_init const union { unsigned long PIOPORCAP1; __pioporcap1_bits PIOPORCAP1_bit; } @ 0x40048104;
volatile __no_init  union { unsigned long BODCTRL; __bodctrl_bits BODCTRL_bit; } @ 0x40048150;
volatile __no_init  union { unsigned long SYSTCKCAL; __systckcal_bits SYSTCKCAL_bit; } @ 0x40048154;
volatile __no_init  union { unsigned long STARTAPRP0; __start_apr_p0_bits STARTAPRP0_bit; } @ 0x40048200;
volatile __no_init  union { unsigned long STARTERP0; __start_er_p0_bits STARTERP0_bit; } @ 0x40048204;
volatile __no_init  union { unsigned long STARTRSRP0CLR; __start_rsr_p0_clr_bits STARTRSRP0CLR_bit; } @ 0x40048208;
volatile __no_init const union { unsigned long STARTSRP0; __start_sr_p0_bits STARTSRP0_bit; } @ 0x4004820C;
volatile __no_init  union { unsigned long PDSLEEPCFG; __pdsleepcfg_bits PDSLEEPCFG_bit; } @ 0x40048230;
volatile __no_init  union { unsigned long PDAWAKECFG; __pdawakecfg_bits PDAWAKECFG_bit; } @ 0x40048234;
volatile __no_init  union { unsigned long PDRUNCFG; __pdawakecfg_bits PDRUNCFG_bit; } @ 0x40048238;
volatile __no_init const unsigned long DEVICE_ID @ 0x400483F4;





 
volatile __no_init  union { unsigned long PCON; __pcon_bits PCON_bit; } @ 0x40038000;
volatile __no_init  unsigned long GPREG0 @ 0x40038004;
volatile __no_init  unsigned long GPREG1 @ 0x40038008;
volatile __no_init  unsigned long GPREG2 @ 0x4003800C;
volatile __no_init  unsigned long GPREG3 @ 0x40038010;
volatile __no_init  union { unsigned long GPREG4; __gpreg4_bits GPREG4_bit; } @ 0x40038014;





 
volatile __no_init  union { unsigned long IOCON_PIO2_6; __iocon_bits IOCON_PIO2_6_bit; } @ 0x40044000;
volatile __no_init  union { unsigned long IOCON_PIO2_0; __iocon_bits IOCON_PIO2_0_bit; } @ 0x40044008;
volatile __no_init  union { unsigned long IOCON_RESET_PIO0_0; __iocon_bits IOCON_RESET_PIO0_0_bit; } @ 0x4004400C;
volatile __no_init  union { unsigned long IOCON_PIO0_1; __iocon_bits IOCON_PIO0_1_bit; } @ 0x40044010;
volatile __no_init  union { unsigned long IOCON_PIO1_8; __iocon_bits IOCON_PIO1_8_bit; } @ 0x40044014;
volatile __no_init  union { unsigned long IOCON_PIO0_2; __iocon_bits IOCON_PIO0_2_bit; } @ 0x4004401C;
volatile __no_init  union { unsigned long IOCON_PIO2_7; __iocon_bits IOCON_PIO2_7_bit; } @ 0x40044020;
volatile __no_init  union { unsigned long IOCON_PIO2_8; __iocon_bits IOCON_PIO2_8_bit; } @ 0x40044024;
volatile __no_init  union { unsigned long IOCON_PIO2_1; __iocon_bits IOCON_PIO2_1_bit; } @ 0x40044028;
volatile __no_init  union { unsigned long IOCON_PIO0_3; __iocon_bits IOCON_PIO0_3_bit; } @ 0x4004402C;
volatile __no_init  union { unsigned long IOCON_PIO0_4; __iocon_pio0_4_bits IOCON_PIO0_4_bit; } @ 0x40044030;
volatile __no_init  union { unsigned long IOCON_PIO0_5; __iocon_pio0_4_bits IOCON_PIO0_5_bit; } @ 0x40044034;
volatile __no_init  union { unsigned long IOCON_PIO1_9; __iocon_bits IOCON_PIO1_9_bit; } @ 0x40044038;
volatile __no_init  union { unsigned long IOCON_PIO3_4; __iocon_bits IOCON_PIO3_4_bit; } @ 0x4004403C;
volatile __no_init  union { unsigned long IOCON_PIO2_4; __iocon_bits IOCON_PIO2_4_bit; } @ 0x40044040;
volatile __no_init  union { unsigned long IOCON_PIO2_5; __iocon_bits IOCON_PIO2_5_bit; } @ 0x40044044;
volatile __no_init  union { unsigned long IOCON_PIO3_5; __iocon_bits IOCON_PIO3_5_bit; } @ 0x40044048;
volatile __no_init  union { unsigned long IOCON_PIO0_6; __iocon_bits IOCON_PIO0_6_bit; } @ 0x4004404C;
volatile __no_init  union { unsigned long IOCON_PIO0_7; __iocon_bits IOCON_PIO0_7_bit; } @ 0x40044050;
volatile __no_init  union { unsigned long IOCON_PIO2_9; __iocon_bits IOCON_PIO2_9_bit; } @ 0x40044054;
volatile __no_init  union { unsigned long IOCON_PIO2_10; __iocon_bits IOCON_PIO2_10_bit; } @ 0x40044058;
volatile __no_init  union { unsigned long IOCON_PIO2_2; __iocon_bits IOCON_PIO2_2_bit; } @ 0x4004405C;
volatile __no_init  union { unsigned long IOCON_PIO0_8; __iocon_bits IOCON_PIO0_8_bit; } @ 0x40044060;
volatile __no_init  union { unsigned long IOCON_PIO0_9; __iocon_bits IOCON_PIO0_9_bit; } @ 0x40044064;
volatile __no_init  union { unsigned long IOCON_SWCLK_PIO0_10; __iocon_bits IOCON_SWCLK_PIO0_10_bit; } @ 0x40044068;
volatile __no_init  union { unsigned long IOCON_PIO1_10; __iocon_pio1_10_bits IOCON_PIO1_10_bit; } @ 0x4004406C;
volatile __no_init  union { unsigned long IOCON_PIO2_11; __iocon_bits IOCON_PIO2_11_bit; } @ 0x40044070;
volatile __no_init  union { unsigned long IOCON_R_PIO0_11; __iocon_pio1_10_bits IOCON_R_PIO0_11_bit; } @ 0x40044074;
volatile __no_init  union { unsigned long IOCON_R_PIO1_0; __iocon_pio1_10_bits IOCON_R_PIO1_0_bit; } @ 0x40044078;
volatile __no_init  union { unsigned long IOCON_R_PIO1_1; __iocon_pio1_10_bits IOCON_R_PIO1_1_bit; } @ 0x4004407C;
volatile __no_init  union { unsigned long IOCON_R_PIO1_2; __iocon_pio1_10_bits IOCON_R_PIO1_2_bit; } @ 0x40044080;
volatile __no_init  union { unsigned long IOCON_PIO3_0; __iocon_bits IOCON_PIO3_0_bit; } @ 0x40044084;
volatile __no_init  union { unsigned long IOCON_PIO3_1; __iocon_bits IOCON_PIO3_1_bit; } @ 0x40044088;
volatile __no_init  union { unsigned long IOCON_PIO2_3; __iocon_bits IOCON_PIO2_3_bit; } @ 0x4004408C;
volatile __no_init  union { unsigned long IOCON_SWDIO_PIO1_3; __iocon_pio1_10_bits IOCON_SWDIO_PIO1_3_bit; } @ 0x40044090;
volatile __no_init  union { unsigned long IOCON_PIO1_4; __iocon_pio1_10_bits IOCON_PIO1_4_bit; } @ 0x40044094;
volatile __no_init  union { unsigned long IOCON_PIO1_11; __iocon_pio1_10_bits IOCON_PIO1_11_bit; } @ 0x40044098;
volatile __no_init  union { unsigned long IOCON_PIO3_2; __iocon_bits IOCON_PIO3_2_bit; } @ 0x4004409C;
volatile __no_init  union { unsigned long IOCON_PIO1_5; __iocon_bits IOCON_PIO1_5_bit; } @ 0x400440A0;
volatile __no_init  union { unsigned long IOCON_PIO1_6; __iocon_bits IOCON_PIO1_6_bit; } @ 0x400440A4;
volatile __no_init  union { unsigned long IOCON_PIO1_7; __iocon_bits IOCON_PIO1_7_bit; } @ 0x400440A8;
volatile __no_init  union { unsigned long IOCON_PIO3_3; __iocon_bits IOCON_PIO3_3_bit; } @ 0x400440AC;
volatile __no_init  union { unsigned long IOCON_SCK_LOC; __iocon_sckloc_bits IOCON_SCK_LOC_bit; } @ 0x400440B0;
volatile __no_init  union { unsigned long IOCON_DSR_LOC; __iocon_dsrloc_bits IOCON_DSR_LOC_bit; } @ 0x400440B4;
volatile __no_init  union { unsigned long IOCON_DCD_LOC; __iocon_dcdloc_bits IOCON_DCD_LOC_bit; } @ 0x400440B8;
volatile __no_init  union { unsigned long IOCON_RI_LOC; __iocon_riloc_bits IOCON_RI_LOC_bit; } @ 0x400440BC;





 
volatile __no_init  union { unsigned long GPIO0DATA; __gpio0_bits GPIO0DATA_bit; } @ 0x50003FFC;
volatile __no_init  union { unsigned long GPIO0DIR; __gpio0_bits GPIO0DIR_bit; } @ 0x50008000;
volatile __no_init  union { unsigned long GPIO0IS; __gpio0_bits GPIO0IS_bit; } @ 0x50008004;
volatile __no_init  union { unsigned long GPIO0IBE; __gpio0_bits GPIO0IBE_bit; } @ 0x50008008;
volatile __no_init  union { unsigned long GPIO0IEV; __gpio0_bits GPIO0IEV_bit; } @ 0x5000800C;
volatile __no_init  union { unsigned long GPIO0IE; __gpio0_bits GPIO0IE_bit; } @ 0x50008010;
volatile __no_init const union { unsigned long GPIO0RIS; __gpio0_bits GPIO0RIS_bit; } @ 0x50008014;
volatile __no_init const union { unsigned long GPIO0MIS; __gpio0_bits GPIO0MIS_bit; } @ 0x50008018;
volatile __no_init  union { unsigned long GPIO0IC; __gpio0_bits GPIO0IC_bit; } @ 0x5000801C;

volatile __no_init  union { unsigned long GPIO1DATA; __gpio1_bits GPIO1DATA_bit; } @ 0x50013FFC;
volatile __no_init  union { unsigned long GPIO1DIR; __gpio1_bits GPIO1DIR_bit; } @ 0x50018000;
volatile __no_init  union { unsigned long GPIO1IS; __gpio1_bits GPIO1IS_bit; } @ 0x50018004;
volatile __no_init  union { unsigned long GPIO1IBE; __gpio1_bits GPIO1IBE_bit; } @ 0x50018008;
volatile __no_init  union { unsigned long GPIO1IEV; __gpio1_bits GPIO1IEV_bit; } @ 0x5001800C;
volatile __no_init  union { unsigned long GPIO1IE; __gpio1_bits GPIO1IE_bit; } @ 0x50018010;
volatile __no_init const union { unsigned long GPIO1RIS; __gpio1_bits GPIO1RIS_bit; } @ 0x50018014;
volatile __no_init const union { unsigned long GPIO1MIS; __gpio1_bits GPIO1MIS_bit; } @ 0x50018018;
volatile __no_init  union { unsigned long GPIO1IC; __gpio1_bits GPIO1IC_bit; } @ 0x5001801C;
 
volatile __no_init  union { unsigned long GPIO2DATA; __gpio2_bits GPIO2DATA_bit; } @ 0x50023FFC;
volatile __no_init  union { unsigned long GPIO2DIR; __gpio2_bits GPIO2DIR_bit; } @ 0x50028000;
volatile __no_init  union { unsigned long GPIO2IS; __gpio2_bits GPIO2IS_bit; } @ 0x50028004;
volatile __no_init  union { unsigned long GPIO2IBE; __gpio2_bits GPIO2IBE_bit; } @ 0x50028008;
volatile __no_init  union { unsigned long GPIO2IEV; __gpio2_bits GPIO2IEV_bit; } @ 0x5002800C;
volatile __no_init  union { unsigned long GPIO2IE; __gpio2_bits GPIO2IE_bit; } @ 0x50028010;
volatile __no_init const union { unsigned long GPIO2RIS; __gpio2_bits GPIO2RIS_bit; } @ 0x50028014;
volatile __no_init const union { unsigned long GPIO2MIS; __gpio2_bits GPIO2MIS_bit; } @ 0x50028018;
volatile __no_init  union { unsigned long GPIO2IC; __gpio2_bits GPIO2IC_bit; } @ 0x5002801C;

volatile __no_init  union { unsigned long GPIO3DATA; __gpio3_bits GPIO3DATA_bit; } @ 0x50033FFC;
volatile __no_init  union { unsigned long GPIO3DIR; __gpio3_bits GPIO3DIR_bit; } @ 0x50038000;
volatile __no_init  union { unsigned long GPIO3IS; __gpio3_bits GPIO3IS_bit; } @ 0x50038004;
volatile __no_init  union { unsigned long GPIO3IBE; __gpio3_bits GPIO3IBE_bit; } @ 0x50038008;
volatile __no_init  union { unsigned long GPIO3IEV; __gpio3_bits GPIO3IEV_bit; } @ 0x5003800C;
volatile __no_init  union { unsigned long GPIO3IE; __gpio3_bits GPIO3IE_bit; } @ 0x50038010;
volatile __no_init const union { unsigned long GPIO3RIS; __gpio3_bits GPIO3RIS_bit; } @ 0x50038014;
volatile __no_init const union { unsigned long GPIO3MIS; __gpio3_bits GPIO3MIS_bit; } @ 0x50038018;
volatile __no_init  union { unsigned long GPIO3IC; __gpio3_bits GPIO3IC_bit; } @ 0x5003801C;





 
volatile __no_init  unsigned char U0RBRTHR @ 0x40008000;

 
volatile __no_init  union { unsigned long U0IER; __uartier_bits U0IER_bit; } @ 0x40008004;

 
volatile __no_init  union { unsigned long U0FCR; __uartfcriir_bits U0FCR_bit; } @ 0x40008008;

volatile __no_init  union { unsigned char U0LCR; __uartlcr_bits U0LCR_bit; } @ 0x4000800C;
volatile __no_init  union { unsigned char U0MCR; __uartmcr_bits U0MCR_bit; } @ 0x40008010;
volatile __no_init const union { unsigned char U0LSR; __uartlsr_bits U0LSR_bit; } @ 0x40008014;
volatile __no_init const union { unsigned char U0MSR; __uartmsr_bits U0MSR_bit; } @ 0x40008018;
volatile __no_init  unsigned char U0SCR @ 0x4000801C;
volatile __no_init  union { unsigned long U0ACR; __uartacr_bits U0ACR_bit; } @ 0x40008020;
volatile __no_init  union { unsigned long U0FDR; __uartfdr_bits U0FDR_bit; } @ 0x40008028;
volatile __no_init  union { unsigned char U0TER; __uartter_bits U0TER_bit; } @ 0x40008030;
volatile __no_init  union { unsigned long U0RS485CTRL; __u1rs485ctrl_bits U0RS485CTRL_bit; } @ 0x4000804C;
volatile __no_init  unsigned char U0ADRMATCH @ 0x40008050;
volatile __no_init  unsigned char U0RS485DLY @ 0x40008054;





 
volatile __no_init  union { unsigned long SSP0CR0; __sspcr0_bits SSP0CR0_bit; } @ 0x40040000;
volatile __no_init  union { unsigned long SSP0CR1; __sspcr1_bits SSP0CR1_bit; } @ 0x40040004;
volatile __no_init  union { unsigned long SSP0DR; __sspdr_bits SSP0DR_bit; } @ 0x40040008;
volatile __no_init const union { unsigned long SSP0SR; __sspsr_bits SSP0SR_bit; } @ 0x4004000C;
volatile __no_init  union { unsigned long SSP0CPSR; __sspcpsr_bits SSP0CPSR_bit; } @ 0x40040010;
volatile __no_init  union { unsigned long SSP0IMSC; __sspimsc_bits SSP0IMSC_bit; } @ 0x40040014;
volatile __no_init  union { unsigned long SSP0RIS; __sspris_bits SSP0RIS_bit; } @ 0x40040018;
volatile __no_init  union { unsigned long SSP0MIS; __sspmis_bits SSP0MIS_bit; } @ 0x4004001C;
volatile __no_init  union { unsigned long SSP0ICR; __sspicr_bits SSP0ICR_bit; } @ 0x40040020;





 
volatile __no_init  union { unsigned long SSP1CR0; __sspcr0_bits SSP1CR0_bit; } @ 0x40058000;
volatile __no_init  union { unsigned long SSP1CR1; __sspcr1_bits SSP1CR1_bit; } @ 0x40058004;
volatile __no_init  union { unsigned long SSP1DR; __sspdr_bits SSP1DR_bit; } @ 0x40058008;
volatile __no_init const union { unsigned long SSP1SR; __sspsr_bits SSP1SR_bit; } @ 0x4005800C;
volatile __no_init  union { unsigned long SSP1CPSR; __sspcpsr_bits SSP1CPSR_bit; } @ 0x40058010;
volatile __no_init  union { unsigned long SSP1IMSC; __sspimsc_bits SSP1IMSC_bit; } @ 0x40058014;
volatile __no_init  union { unsigned long SSP1RIS; __sspris_bits SSP1RIS_bit; } @ 0x40058018;
volatile __no_init  union { unsigned long SSP1MIS; __sspmis_bits SSP1MIS_bit; } @ 0x4005801C;
volatile __no_init  union { unsigned long SSP1ICR; __sspicr_bits SSP1ICR_bit; } @ 0x40058020;





 
volatile __no_init  union { unsigned long I2C0CONSET; __i2conset_bits I2C0CONSET_bit; } @ 0x40000000;
volatile __no_init const union { unsigned long I2C0STAT; __i2stat_bits I2C0STAT_bit; } @ 0x40000004;
volatile __no_init  union { unsigned long I2C0DAT; __i2dat_bits I2C0DAT_bit; } @ 0x40000008;
volatile __no_init  union { unsigned long I2C0ADR; __i2adr_bits I2C0ADR_bit; } @ 0x4000000C;
volatile __no_init  union { unsigned long I2C0SCLH; __i2sch_bits I2C0SCLH_bit; } @ 0x40000010;
volatile __no_init  union { unsigned long I2C0SCLL; __i2scl_bits I2C0SCLL_bit; } @ 0x40000014;
volatile __no_init  union { unsigned long I2C0CONCLR; __i2conclr_bits I2C0CONCLR_bit; } @ 0x40000018;
volatile __no_init  union { unsigned long I2C0MMCTRL; __i2cmmctrl_bits I2C0MMCTRL_bit; } @ 0x4000001C;
volatile __no_init  union { unsigned long I2C0ADR1; __i2adr_bits I2C0ADR1_bit; } @ 0x40000020;
volatile __no_init  union { unsigned long I2C0ADR2; __i2adr_bits I2C0ADR2_bit; } @ 0x40000024;
volatile __no_init  union { unsigned long I2C0ADR3; __i2adr_bits I2C0ADR3_bit; } @ 0x40000028;
volatile __no_init const union { unsigned long I2C0DATABUFFER; __i2dat_bits I2C0DATABUFFER_bit; } @ 0x4000002C;
volatile __no_init  union { unsigned long I2C0MASK0; __i2cmask_bits I2C0MASK0_bit; } @ 0x40000030;
volatile __no_init  union { unsigned long I2C0MASK1; __i2cmask_bits I2C0MASK1_bit; } @ 0x40000034;
volatile __no_init  union { unsigned long I2C0MASK2; __i2cmask_bits I2C0MASK2_bit; } @ 0x40000038;
volatile __no_init  union { unsigned long I2C0MASK3; __i2cmask_bits I2C0MASK3_bit; } @ 0x4000003C;





 
volatile __no_init  union { unsigned long TMR16B0IR; __ir_bits TMR16B0IR_bit; } @ 0x4000C000;
volatile __no_init  union { unsigned long TMR16B0TCR; __tcr_bits TMR16B0TCR_bit; } @ 0x4000C004;
volatile __no_init  unsigned short TMR16B0TC @ 0x4000C008;
volatile __no_init  unsigned short TMR16B0PR @ 0x4000C00C;
volatile __no_init  unsigned short TMR16B0PC @ 0x4000C010;
volatile __no_init  union { unsigned long TMR16B0MCR; __mcr_bits TMR16B0MCR_bit; } @ 0x4000C014;
volatile __no_init  unsigned short TMR16B0MR0 @ 0x4000C018;
volatile __no_init  unsigned short TMR16B0MR1 @ 0x4000C01C;
volatile __no_init  unsigned short TMR16B0MR2 @ 0x4000C020;
volatile __no_init  unsigned short TMR16B0MR3 @ 0x4000C024;
volatile __no_init  union { unsigned long TMR16B0CCR; __tccr_bits TMR16B0CCR_bit; } @ 0x4000C028;
volatile __no_init const unsigned short TMR16B0CR0 @ 0x4000C02C;
volatile __no_init  union { unsigned long TMR16B0EMR; __emr_bits TMR16B0EMR_bit; } @ 0x4000C03C;
volatile __no_init  union { unsigned long TMR16B0CTCR; __ctcr_bits TMR16B0CTCR_bit; } @ 0x4000C070;
volatile __no_init  union { unsigned long TMR16B0PWMC; __pwmc_bits TMR16B0PWMC_bit; } @ 0x4000C074;





 
volatile __no_init  union { unsigned long TMR16B1IR; __ir_bits TMR16B1IR_bit; } @ 0x40010000;
volatile __no_init  union { unsigned long TMR16B1TCR; __tcr_bits TMR16B1TCR_bit; } @ 0x40010004;
volatile __no_init  unsigned short TMR16B1TC @ 0x40010008;
volatile __no_init  unsigned short TMR16B1PR @ 0x4001000C;
volatile __no_init  unsigned short TMR16B1PC @ 0x40010010;
volatile __no_init  union { unsigned long TMR16B1MCR; __mcr_bits TMR16B1MCR_bit; } @ 0x40010014;
volatile __no_init  unsigned short TMR16B1MR0 @ 0x40010018;
volatile __no_init  unsigned short TMR16B1MR1 @ 0x4001001C;
volatile __no_init  unsigned short TMR16B1MR2 @ 0x40010020;
volatile __no_init  unsigned short TMR16B1MR3 @ 0x40010024;
volatile __no_init  union { unsigned long TMR16B1CCR; __tccr_bits TMR16B1CCR_bit; } @ 0x40010028;
volatile __no_init const unsigned short TMR16B1CR0 @ 0x4001002C;
volatile __no_init  union { unsigned long TMR16B1EMR; __emr_bits TMR16B1EMR_bit; } @ 0x4001003C;
volatile __no_init  union { unsigned long TMR16B1CTCR; __ctcr_bits TMR16B1CTCR_bit; } @ 0x40010070;
volatile __no_init  union { unsigned long TMR16B1PWMC; __pwmc_bits TMR16B1PWMC_bit; } @ 0x40010074;





 
volatile __no_init  union { unsigned long TMR32B0IR; __ir_bits TMR32B0IR_bit; } @ 0x40014000;
volatile __no_init  union { unsigned long TMR32B0TCR; __tcr_bits TMR32B0TCR_bit; } @ 0x40014004;
volatile __no_init  unsigned long TMR32B0TC @ 0x40014008;
volatile __no_init  unsigned long TMR32B0PR @ 0x4001400C;
volatile __no_init  unsigned long TMR32B0PC @ 0x40014010;
volatile __no_init  union { unsigned long TMR32B0MCR; __mcr_bits TMR32B0MCR_bit; } @ 0x40014014;
volatile __no_init  unsigned long TMR32B0MR0 @ 0x40014018;
volatile __no_init  unsigned long TMR32B0MR1 @ 0x4001401C;
volatile __no_init  unsigned long TMR32B0MR2 @ 0x40014020;
volatile __no_init  unsigned long TMR32B0MR3 @ 0x40014024;
volatile __no_init  union { unsigned long TMR32B0CCR; __tccr_bits TMR32B0CCR_bit; } @ 0x40014028;
volatile __no_init const unsigned long TMR32B0CR0 @ 0x4001402C;
volatile __no_init  union { unsigned long TMR32B0EMR; __emr_bits TMR32B0EMR_bit; } @ 0x4001403C;
volatile __no_init  union { unsigned long TMR32B0CTCR; __ctcr_bits TMR32B0CTCR_bit; } @ 0x40014070;
volatile __no_init  union { unsigned long TMR32B0PWMC; __pwmc_bits TMR32B0PWMC_bit; } @ 0x40014074;





 
volatile __no_init  union { unsigned long TMR32B1IR; __ir_bits TMR32B1IR_bit; } @ 0x40018000;
volatile __no_init  union { unsigned long TMR32B1TCR; __tcr_bits TMR32B1TCR_bit; } @ 0x40018004;
volatile __no_init  unsigned long TMR32B1TC @ 0x40018008;
volatile __no_init  unsigned long TMR32B1PR @ 0x4001800C;
volatile __no_init  unsigned long TMR32B1PC @ 0x40018010;
volatile __no_init  union { unsigned long TMR32B1MCR; __mcr_bits TMR32B1MCR_bit; } @ 0x40018014;
volatile __no_init  unsigned long TMR32B1MR0 @ 0x40018018;
volatile __no_init  unsigned long TMR32B1MR1 @ 0x4001801C;
volatile __no_init  unsigned long TMR32B1MR2 @ 0x40018020;
volatile __no_init  unsigned long TMR32B1MR3 @ 0x40018024;
volatile __no_init  union { unsigned long TMR32B1CCR; __tccr_bits TMR32B1CCR_bit; } @ 0x40018028;
volatile __no_init const unsigned long TMR32B1CR0 @ 0x4001802C;
volatile __no_init  union { unsigned long TMR32B1EMR; __emr_bits TMR32B1EMR_bit; } @ 0x4001803C;
volatile __no_init  union { unsigned long TMR32B1CTCR; __ctcr_bits TMR32B1CTCR_bit; } @ 0x40018070;
volatile __no_init  union { unsigned long TMR32B1PWMC; __pwmc_bits TMR32B1PWMC_bit; } @ 0x40018074;





 
volatile __no_init  union { unsigned long AD0CR; __adcr_bits AD0CR_bit; } @ 0x4001C000;
volatile __no_init  union { unsigned long AD0GDR; __adgdr_bits AD0GDR_bit; } @ 0x4001C004;
volatile __no_init  union { unsigned long AD0INTEN; __adinten_bits AD0INTEN_bit; } @ 0x4001C00C;
volatile __no_init const union { unsigned long AD0DR0; __addr_bits AD0DR0_bit; } @ 0x4001C010;
volatile __no_init const union { unsigned long AD0DR1; __addr_bits AD0DR1_bit; } @ 0x4001C014;
volatile __no_init const union { unsigned long AD0DR2; __addr_bits AD0DR2_bit; } @ 0x4001C018;
volatile __no_init const union { unsigned long AD0DR3; __addr_bits AD0DR3_bit; } @ 0x4001C01C;
volatile __no_init const union { unsigned long AD0DR4; __addr_bits AD0DR4_bit; } @ 0x4001C020;
volatile __no_init const union { unsigned long AD0DR5; __addr_bits AD0DR5_bit; } @ 0x4001C024;
volatile __no_init const union { unsigned long AD0DR6; __addr_bits AD0DR6_bit; } @ 0x4001C028;
volatile __no_init const union { unsigned long AD0DR7; __addr_bits AD0DR7_bit; } @ 0x4001C02C;
volatile __no_init const union { unsigned long AD0STAT; __adstat_bits AD0STAT_bit; } @ 0x4001C030;





 
volatile __no_init  union { unsigned long WDMOD; __wdmod_bits WDMOD_bit; } @ 0x40004000;
volatile __no_init  unsigned long WDTC @ 0x40004004;
volatile __no_init  union { unsigned long WDFEED; __wdfeed_bits WDFEED_bit; } @ 0x40004008;
volatile __no_init const unsigned long WDTV @ 0x4000400C;





 
volatile __no_init  union { unsigned long FLASHCFG; __flashcfg_bits FLASHCFG_bit; } @ 0x4003C010;





 
volatile __no_init  union { unsigned long FMSSTART; __fmsstart_bits FMSSTART_bit; } @ 0x4003C020;
volatile __no_init  union { unsigned long FMSSTOP; __fmsstop_bits FMSSTOP_bit; } @ 0x4003C024;
volatile __no_init const unsigned long FMSW0 @ 0x4003C02C;
volatile __no_init const unsigned long FMSW1 @ 0x4003C030;
volatile __no_init const unsigned long FMSW2 @ 0x4003C034;
volatile __no_init const unsigned long FMSW3 @ 0x4003C038;
volatile __no_init const union { unsigned long FMSTAT; __fmstat_bits FMSTAT_bit; } @ 0x4003CFE0;
volatile __no_init  union { unsigned long FMSTATCLR; __fmstatclr_bits FMSTATCLR_bit; } @ 0x4003CFE8;



 






 








































 











 






typedef double                Flo64;    
typedef double              * pFlo64;
typedef float                 Flo32;    
typedef float               * pFlo32;
typedef signed   long long    Int64S;   
typedef signed   long long  * pInt64S;
typedef unsigned long long    Int64U;   
typedef unsigned long long  * pInt64U;
typedef signed   int          Int32S;   
typedef signed   int        * pInt32S;
typedef unsigned int          Int32U;   
typedef unsigned int        * pInt32U;
typedef signed   short        Int16S;   
typedef signed   short      * pInt16S;
typedef unsigned short        Int16U;   
typedef unsigned short      * pInt16U;
typedef signed   char         Int8S;    
typedef signed   char       * pInt8S;
typedef unsigned char         Int8U;    
typedef unsigned char       * pInt8U;
typedef unsigned int          Boolean;  
typedef unsigned int        * pBoolean;


typedef void * (*CommUserFpnt_t)(void *);
typedef void   (*VoidFpnt_t)(void);

















 










 































































extern volatile unsigned int 	Timer10ms[24];










 










 


 
 





 
 
 





 






extern char BuffDebug[256];

static unsigned int TeclaValida;
static unsigned char TeclaAnt, TeclaAtual;

unsigned int EstRdKbd;

void ReadKbd(void)
{
	unsigned int tempTecla;
	
	switch(EstRdKbd)
	{
		case kbdParado:
			if(!Timer10ms[20])
			{	
				(*((volatile unsigned int *)(0x50010000+((1UL<<3)<<2)))) = 0;
				(*((volatile unsigned int *)(0x50010000+((1UL<<9)<<2)))) = 0x7FF;
				(*((volatile unsigned int *)(0x50010000+((1UL<<10)<<2)))) = 0x7FF;
				EstRdKbd = kbdRdCol1;
			}
			break;	

		case kbdRdCol1:
			if(!Timer10ms[20])
			{
				tempTecla = GPIO1DATA;
				if((tempTecla & 0x07) != 0x07)
				{	
					tempTecla &= 0x07;
					if	   (tempTecla == 0x03)		tempTecla = (1UL<<0);
					else if(tempTecla == 0x05)		tempTecla = (1UL<<3);
					else if(tempTecla == 0x06)		tempTecla = (1UL<<8);
					else tempTecla = 0;
					if(TeclaAnt == tempTecla)
					{	
						if(tempTecla)	
						{
							TeclaAtual = TeclaAnt;	
						}
					}
					else 
					{
						TeclaAnt = tempTecla;	
					}
					Timer10ms[20] = 4;	
				}
				else
				{	
					if(TeclaAtual)
					{	
						TeclaValida = TeclaAtual;
						TeclaAtual = 0;
					}
					TeclaAnt = 0;
					(*((volatile unsigned int *)(0x50010000+((1UL<<3)<<2)))) = 0x7FF;
					(*((volatile unsigned int *)(0x50010000+((1UL<<9)<<2)))) = 0;
					(*((volatile unsigned int *)(0x50010000+((1UL<<10)<<2)))) = 0x7FF;
					Timer10ms[20] = 4;	
					EstRdKbd = kbdRdCol2;
				}
			}
			break;

		case kbdRdCol2:
			if(!Timer10ms[20])
			{
				tempTecla = GPIO1DATA;
				if((tempTecla & 0x07) != 0x07)
				{	
					tempTecla &= 0x07;
					if	   (tempTecla == 0x03)		tempTecla = (1UL<<1);
					else if(tempTecla == 0x05)		tempTecla = (1UL<<4);
					else if(tempTecla == 0x06)		tempTecla = (1UL<<9);
					else tempTecla = 0;
					if(TeclaAnt == tempTecla)
					{	
						if(tempTecla)	TeclaAtual = TeclaAnt;	
					}
					else 
					{
						TeclaAnt = tempTecla;	
					}
					Timer10ms[20] = 4;	
				}
				else
				{	
					if(TeclaAtual)
					{	
						TeclaValida = TeclaAtual;
						TeclaAtual = 0;
					}
					TeclaAnt = 0;
					(*((volatile unsigned int *)(0x50010000+((1UL<<3)<<2)))) = 0x7FF;
					(*((volatile unsigned int *)(0x50010000+((1UL<<9)<<2)))) = 0x7FF;
					(*((volatile unsigned int *)(0x50010000+((1UL<<10)<<2)))) = 0;
					Timer10ms[20] = 4;	
					EstRdKbd = kbdRdCol3;
				}
			}
			break;

		case kbdRdCol3:
			if(!Timer10ms[20])
			{
				tempTecla = GPIO1DATA;
				if((tempTecla & 0x07) != 0x07)
				{	
					tempTecla &= 0x07;
					if	   (tempTecla == 0x03)		tempTecla = (1UL<<2);
					else if(tempTecla == 0x05)		tempTecla = (1UL<<5);
					else if(tempTecla == 0x06)		tempTecla = (1UL<<10);
					else tempTecla = 0;
					if(TeclaAnt == tempTecla)
					{	
						if(tempTecla)	TeclaAtual = TeclaAnt;	
					}
					else 
					{
						TeclaAnt = tempTecla;	
					}
					Timer10ms[20] = 4;	
				}
				else
				{	
					if(TeclaAtual)
					{	
						TeclaValida = TeclaAtual;
						TeclaAtual = 0;
					}
					TeclaAnt = 0;
					EstRdKbd = kbdParado;
					Timer10ms[20] = 4;
				}
			}
			break;
	}
}

unsigned int TeclaVal(void)
{
	unsigned int retorno;
	retorno = TeclaValida;
	TeclaValida = 0;
	return(retorno);
}



